Title: Link compile errors in VB Post by: VilanceDAsari on July 23, 2010, 11:26:56 am Hi, I searched for a response to this error, and this post is the closest I have seen to the problem I have.
I almost got UQM to compile in one night thanks to the guide here: http://forum.uqm.stack.nl/index.php?topic=1590.msg20369#msg20369 Basically it compiles and can play but the net components are not seeing the linker here are the error codes: Code: getopt.c Generating Code... connect.obj : error LNK2019: unresolved external symbol __imp__freeaddrinfo@4 referenced in function _ConnectState_close listen.obj : error LNK2019: unresolved external symbol __imp__inet_ntoa@4 referenced in function _WspiapiLegacyGetAddrInfo@16 resolve.obj : error LNK2001: unresolved external symbol __imp__inet_ntoa@4 listen.obj : error LNK2019: unresolved external symbol __imp__htonl@4 referenced in function _WspiapiLegacyGetAddrInfo@16 resolve.obj : error LNK2001: unresolved external symbol __imp__htonl@4 listen.obj : error LNK2019: unresolved external symbol __imp__getservbyname@8 referenced in function _WspiapiLegacyGetAddrInfo@16 resolve.obj : error LNK2001: unresolved external symbol __imp__getservbyname@8 listen.obj : error LNK2019: unresolved external symbol __imp__htons@4 referenced in function _WspiapiLegacyGetAddrInfo@16 resolve.obj : error LNK2001: unresolved external symbol __imp__htons@4 listen.obj : error LNK2019: unresolved external symbol __imp__inet_addr@4 referenced in function _WspiapiParseV4Address@8 resolve.obj : error LNK2001: unresolved external symbol __imp__inet_addr@4 listen.obj : error LNK2019: unresolved external symbol __imp__WSAGetLastError@0 referenced in function _WspiapiQueryDNS@24 resolve.obj : error LNK2001: unresolved external symbol __imp__WSAGetLastError@0 netmanager_win.obj : error LNK2001: unresolved external symbol __imp__WSAGetLastError@0 netport.obj : error LNK2001: unresolved external symbol __imp__WSAGetLastError@0 listen.obj : error LNK2019: unresolved external symbol __imp__gethostbyname@4 referenced in function _WspiapiQueryDNS@24 resolve.obj : error LNK2001: unresolved external symbol __imp__gethostbyname@4 listen.obj : error LNK2019: unresolved external symbol __imp__gethostbyaddr@12 referenced in function _WspiapiLegacyGetNameInfo@28 resolve.obj : error LNK2001: unresolved external symbol __imp__gethostbyaddr@12 listen.obj : error LNK2019: unresolved external symbol __imp__getservbyport@8 referenced in function _WspiapiLegacyGetNameInfo@28 resolve.obj : error LNK2001: unresolved external symbol __imp__getservbyport@8 listen.obj : error LNK2019: unresolved external symbol __imp__ntohs@4 referenced in function _WspiapiLegacyGetNameInfo@28 resolve.obj : error LNK2001: unresolved external symbol __imp__ntohs@4 resolve.obj : error LNK2019: unresolved external symbol __imp__WSASetLastError@4 referenced in function _WspiapiGetAddrInfo@16 netmanager_win.obj : error LNK2019: unresolved external symbol __imp__WSACloseEvent@4 referenced in function _closeWSAEvent netmanager_win.obj : error LNK2019: unresolved external symbol __imp__WSAEventSelect@12 referenced in function _NetManager_addDesc netmanager_win.obj : error LNK2019: unresolved external symbol __imp__WSACreateEvent@0 referenced in function _NetManager_addDesc netmanager_win.obj : error LNK2019: unresolved external symbol __imp__WSAWaitForMultipleEvents@20 referenced in function _NetManager_process netmanager_win.obj : error LNK2019: unresolved external symbol __imp__WSAEnumNetworkEvents@12 referenced in function _NetManager_processEvent network_win.obj : error LNK2019: unresolved external symbol __imp__WSACleanup@0 referenced in function _Network_init network_win.obj : error LNK2019: unresolved external symbol __imp__WSAStartup@8 referenced in function _Network_init socket_win.obj : error LNK2019: unresolved external symbol __imp__socket@12 referenced in function _Socket_openNative socket_win.obj : error LNK2019: unresolved external symbol __imp__closesocket@4 referenced in function _Socket_close socket_win.obj : error LNK2019: unresolved external symbol __imp__connect@12 referenced in function _Socket_connect socket_win.obj : error LNK2019: unresolved external symbol __imp__bind@12 referenced in function _Socket_bind socket_win.obj : error LNK2019: unresolved external symbol __imp__listen@8 referenced in function _Socket_listen socket_win.obj : error LNK2019: unresolved external symbol __imp__accept@12 referenced in function _Socket_accept socket_win.obj : error LNK2019: unresolved external symbol __imp__send@16 referenced in function _Socket_send socket_win.obj : error LNK2019: unresolved external symbol __imp__recv@16 referenced in function _Socket_recv socket_win.obj : error LNK2019: unresolved external symbol __imp__ioctlsocket@12 referenced in function _Socket_setNonBlocking socket_win.obj : error LNK2019: unresolved external symbol __imp__setsockopt@20 referenced in function _Socket_setReuseAddr socket_win.obj : error LNK2019: unresolved external symbol __imp__getsockopt@20 referenced in function _Socket_getError melee.obj : error LNK2019: unresolved external symbol _DrawMeleeStatusMessage referenced in function _StartMeleeButtonPressed netmisc.obj : error LNK2019: unresolved external symbol _closeFeedback referenced in function _NetMelee_closeCallback netmisc.obj : error LNK2019: unresolved external symbol _errorFeedback referenced in function _NetMelee_errorCallback netmisc.obj : error LNK2019: unresolved external symbol _connectedFeedback referenced in function _NetMelee_enterState_inSetup packethandlers.obj : error LNK2019: unresolved external symbol _abortFeedback referenced in function _PacketHandler_Init packethandlers.obj : error LNK2019: unresolved external symbol _updateFleetShip referenced in function _PacketHandler_Fleet packethandlers.obj : error LNK2019: unresolved external symbol _confirmationCancelled referenced in function _PacketHandler_Fleet packethandlers.obj : error LNK2019: unresolved external symbol _updateTeamName referenced in function _PacketHandler_TeamName packethandlers.obj : error LNK2019: unresolved external symbol _updateRandomSeed referenced in function _PacketHandler_SeedRandom packethandlers.obj : error LNK2019: unresolved external symbol _updateMeleeSelection referenced in function _PacketHandler_SelectShip packethandlers.obj : error LNK2019: unresolved external symbol _addRemoteChecksum referenced in function _PacketHandler_Checksum packethandlers.obj : error LNK2001: unresolved external symbol _battleFrameCount reset.obj : error LNK2019: unresolved external symbol _resetFeedback referenced in function _Netplay_connectionReset F:\uqm\UM\uqm-0.6.2\src\msvc++\Debug\uqm.exe : fatal error LNK1120: 43 unresolved externals ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== As you can see these are all related to netplay options. Prior to that everything compiles. I have tried the fix listed on the thread that had very similar answers here: http://forum.uqm.stack.nl/index.php?topic=4353.0 The suggestion there was to remove the code in the wspiapiwrap.h and replace it with just: <wspiapi.h>. I tried that and also the reverse using winsock2, and <ws2tcpip.h>, and I even copied the ws2_32.dll into a linker directory. So any ideas would be appreciated. System specs: Windows Xp & VS 10 C++, not sure if that has anything to do with these issues. Support software versions : oggvorbis-win32sdk-1.0.1 SDL-1.2.14 SDL_image-1.2.10 uqm-0.6.2 zlib1.2.3 (has the zdll.lib and header files) libpng1.dll - is version 1.0.8.0 from the OpenAL 1.1 SDK I think it way be some kind of glitch with VS 10, but since I am using Xp I am not sure where the real problem with the network play link errors. Please any help is welcome! V. Title: Re: Link compile errors in VB Post by: meep-eep on July 23, 2010, 05:42:38 pm I don't have Windows here, so I'll have to do this blindly:
For the __imp__ symbols, you need to link in another .dll file, probably ws2_32.dll. Going by one of your links, you should be able to find the relevant setting under `Project/Properties/Linker/Input, Additional Dependancies'. The other ones are part of UQM and should have been found. Did you switch from compiling without Netplay to compiling with netplay? If so, try cleaning your build completely, and then building again. If not, you may be missing some files in your project, probably those under the netplay/ folder. Title: Re: Link compile errors in VB Post by: VilanceDAsari on July 24, 2010, 12:24:06 am 1st off, thanks for the timely response!
No I never removed the netplay components its just never thrown an error on the pre-link or post link phase of the compile, theoretically I might get a link error on the compile portion of the non-netplay objects, but I assume (and i admit i could be wrong here) that if there were some link errors on the non-netplay components they would show up with all the other link errors I see. Hmm...Ok I copied my ws2_32.dll into a folder I designated as additional library directory, I will add it to the list of linker dependencies (kind leary to do that though all .lib files) ...testing now... Code: ------ Build started: Project: uqm, Configuration: Debug Win32 ------ F:\uqm\UM\uqm-0.6.2\src\ws2_32.dll : fatal error LNK1107: invalid or corrupt file: cannot read at 0x288 ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== Didnt like this file in the props/config->linker->input->additional dependencies threw above error. Also I should probably copy my current versions of the wspiapiwrap files: Code: #ifndef _WSPIAPIWRAP_H and the .c file:#define _WSPIAPIWRAP_H //#include <winsock2.h> //#include <ws2tcpip.h> #include <wspiapi.h> #endif /* _WSPIAPIWRAP_H */ Code: #include "netport.h" //#if defined(USE_WINSOCK) && defined(__MINGW32__) //# include <ws2tcpip.h> //# include <wspiapi.h> //#endif just tried this header version didnt work either: Code: #ifndef _WSPIAPIWRAP_H LOL so frustrating because I feel like I am so close!!#define _WSPIAPIWRAP_H #include <winsock2.h> #include <ws2tcpip.h> #include <wspiapi.h> #endif /* _WSPIAPIWRAP_H */ V. Title: Re: Link compile errors in VB Post by: meep-eep on July 25, 2010, 10:52:45 am I think you may have added ws3_32.dll as a source code file, and not as a library.
Oh, wait, you may need a ws2_32.lib file. Someone with access to a Windows system who can help here? As for the headers, I've never tried that patch myself, but if those headers are wrong, you would have gotten different errors. The headers you used when you got the errors listed in your first posting were probably correct. Also, UQM is written in C, not in VB. |