简体   繁体   中英

Visual Studio cant link on 32 bit but can on 64bit

I created a project and as I always do I created 2 platforms (64 and 32 bit) (this is a DLL). I wrote the code and tested it and everything went great (I always test on 64bit configuration) but as I wanted to test on my 32bit XP VM I struggle a LINK problem.

I am using the API WSASelectEvent in my code (as a lot of other WSA/Winsock apis) but in 32 bit configuration and only in 32 bit configuration the linker refuse to find _WSASelectEvent.

I get the well known LNK2001 error :

"error LNK2001: unresolved external symbol _WSAEventSelect"

I sure link to ws2_32.lib and I sure include winsock2.h as I use other apis (such as WSAStartup and WSACleanup and structs and whatnot in my code, obviously to use winsockets).

so knowing me liking to mess around with configuration mid-work (this is a rather small project nothing too big) I decided ill go for sure and created a new project in visual studio place the code in and create a new platform to compile in (with the GUI of-course) but I've got the same results.

I have been for 2-3 hours surfing the net to no fix and I even tried comparing the compile command line and link command line which apart of the normal /MACHINE:x64/x86 and target folders is exactly the same.

do you maybe know this problem or a solution to it?

NOTE:: intellisense warn me about this and visual studio wont suggest parameters list when WSASelectEvent( is written, but "Go to Definition" sure takes me to Winsock2.h.

SOLVED,

ok so apparently I did a mess with the inclusion of my own libraries. after including winsock2.h in couple of other places I managed to compile it on 32 bit aswell.

Thanks for your time!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM