linker - Building Visual C++ app that doesn't use CRT functions still references some -


This is part of a chain of at least two related closely, but there are specific questions. I hope I am doing the right thing by asking them separately.

I'm trying to get my Visual C ++ 2008 app to work without the Sea Runtime Library. It's a Win32 GUI app without MFC or other fancy stuff, just plain Windows API.

So I run the project properties -> Configuration -> C / C ++ -> Advanced -> Yes in the default library name (yes compiler flag / Zl ) and then create it again Excuse me I have written a suitable entry point function, which is the subject of

I get two linker errors; They may be related, the linker complains about the unresolved external symbols __ fltused and _memcpy in foobar.obj . Needless to say, I do not use plainly in my program, but I use memcpy anywhere foobar.cpp . (I used to have it, but it turns out to be similar to #define d like memcpy )

(I thought I could get memcpy Get rid of the problem by using a compiler internal, like #pragma intrinsic (memcpy) , but it does not matter.)

I do not have any reference to foobar in __ fltused or _memcpy on the preprocessor output (by adding / p to the compiler command line) Is getting .i . .

So, my question is: Where do these linkar errors come from, and how do I solve them?

__ fltused means that you at least Some floats or doubles are using or at least. The compiler causes this 'useless' symbol to be a temporary support. To get the BOJ filled with CRT. You can get it by simply declaring symbols with the name

  #ifdef __cplusplus extern "c" {#endif int __fltused = 0; #ifdef __cplusplus} #endif  

WRT _memcpy - memcpy is a __cdecl function, and all cdecl functions get an auto _ as part of their decoration. Therefore, when you say "__cdecl memcpy" - compiler & amp; The linker is looking for a symbol called '_memcpy' - internal functions - even explicitly requested - can still be imported if the build setting has a debug setting that would counter-intercept anti So you will need to implement your own memcpy and related tasks in any way.


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -