简体   繁体   中英

linker error after changed the type of c++ project from x86 to x64

I had a project which was compiled and liked well, but I need to linked it with a 64 bit library and I tried to change the type of project to 64 and now the project doesn't linked correctly.

The error that I am getting is:

Error   1   error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'   \createDLL.obj

checking output, I can see that the linker is called in this way:

C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\link.exe /ERRORREPORT:PROMPT /OUT:"..\Debug\createDLL.exe" /INCREMENTAL /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /DEBUG /PDB:"..\Debug\createDLL.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE:NO /IMPLIB:"..\Debug\createDLL.lib" /MACHINE:X64 /SAFESEH Debug\createDLL.obj

apparently the linker is looking for an obj which compiled for 64 but it can not find it

How can I set the compiler to compile for x64?

I am using VS 2012

1)Try to get 32 bit version of the library if possible.

2)Check the options in Project->Properties->Configuration properties->Linker . Check settings in General , Input & Advanced pages mainly in it.Should solve your problem

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