Unresolved external symbol

Possible duplicate:
What is an undefined link / unresolved external symbol error and how to fix it?

I am working on porting a large number of .h and .lib files from C ++ to managed C ++ for possible use as a reference .dll in C #.

I have .lib files and everything is going smoothly so far. After wrapping the last .h file, I fell into the trap when 2 functions returned with a link:

error LNK2019: unresolved external symbol __imp__htonl@4 referenced in function
"public: void __thiscall Field::setCharacter(unsigned char,int)"
(?setCharacter@Field@@QAEXEH@Z) myutils.lib 

I refer to myutils.libin the linker options, so this should not be a problem.

Which is strange that I have about 20 functions in this particular .h file, and all the rest are just fine, with the exception of three functions.

Any ideas?

+5
3

__imp__htonl@4, ++ htonl, , . @4 ++ , .

, , . , - , MACRO, .

+4

, ? . , , .

+1

I ran into this error when I compiled the library and then changed the library before its link. Make sure your headers are the same as in your library (not copied from another architecture, etc.). Of course, make sure you contact ws2_32.lib (-lws2_32 for mingw / gcc).

Also, if you use GCC / mingw, you can take a look at this: MinGW Linker Error: winsock

+1
source

All Articles