User forums > General (but related to Code::Blocks)

Linker target messsed up on single file

(1/6) > >>

awsdert:
I know I'm not supposed to post linkage stuff but I think mine is being caused by a setting in my project and I'm clueless to what is causing it, could someone help me identify the setting and explain what went wrong, I'm presuming the attachment and the below should be all you need but let me know if you need more or if this is not a setting problem. BTW my MSVS version is 2013 I simply modified the MSVS 2010 settings to use that instead.

--- Code: ----------------- Clean: libzxs-x64-d-vc in libzxs (compiler: Microsoft Visual C++ 2010)---------------

Cleaned "libzxs - libzxs-x64-d-vc"

-------------- Build: libzxs-x64-d-vc in libzxs (compiler: Microsoft Visual C++ 2010)---------------

cl.exe /nologo -DDIRECTINPUT_VERSION=0x0800 -DZX__BUILD  /Zi /D_DEBUG /D_AMD64_ /D_WIN64  /D_USING_V110_SDK71_   /Iinclude /IC:\sdk\MSDX-2010-06\include /I"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\include" /IC:\p\MSVS-x86\VC\include /c libzxs.c /Foobj\libzxs-x64-d-vc\libzxs.obj
libzxs.c
cl.exe /nologo -DDIRECTINPUT_VERSION=0x0800 -DZX__BUILD  /Zi /D_DEBUG /D_AMD64_ /D_WIN64  /D_USING_V110_SDK71_   /Iinclude /IC:\sdk\MSDX-2010-06\include /I"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\include" /IC:\p\MSVS-x86\VC\include /c main.c /Foobj\libzxs-x64-d-vc\main.obj
main.c
cl.exe /nologo -DDIRECTINPUT_VERSION=0x0800 -DZX__BUILD  /Zi /D_DEBUG /D_AMD64_ /D_WIN64  /D_USING_V110_SDK71_   /Iinclude /IC:\sdk\MSDX-2010-06\include /I"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\include" /IC:\p\MSVS-x86\VC\include /c src\dirent.c /Foobj\libzxs-x64-d-vc\src\dirent.obj
dirent.c
cl.exe /nologo -DDIRECTINPUT_VERSION=0x0800 -DZX__BUILD  /Zi /D_DEBUG /D_AMD64_ /D_WIN64  /D_USING_V110_SDK71_   /Iinclude /IC:\sdk\MSDX-2010-06\include /I"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\include" /IC:\p\MSVS-x86\VC\include /c src\zxs\acs.c /Foobj\libzxs-x64-d-vc\src\zxs\acs.obj
acs.c
cl.exe /nologo -DDIRECTINPUT_VERSION=0x0800 -DZX__BUILD  /Zi /D_DEBUG /D_AMD64_ /D_WIN64  /D_USING_V110_SDK71_   /Iinclude /IC:\sdk\MSDX-2010-06\include /I"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\include" /IC:\p\MSVS-x86\VC\include /c src\zxs\fso.c /Foobj\libzxs-x64-d-vc\src\zxs\fso.obj
fso.c
cl.exe /nologo -DDIRECTINPUT_VERSION=0x0800 -DZX__BUILD  /Zi /D_DEBUG /D_AMD64_ /D_WIN64  /D_USING_V110_SDK71_   /Iinclude /IC:\sdk\MSDX-2010-06\include /I"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\include" /IC:\p\MSVS-x86\VC\include /c src\zxs\wcs.c /Foobj\libzxs-x64-d-vc\src\zxs\wcs.obj
wcs.c
link.exe /nologo /LIBPATH:C:\sdk\MSDX-2010-06\lib\x64 /LIBPATH:"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\lib\x64" /LIBPATH:C:\p\MSVS-x86\VC\lib\amd64 /out:bin\libzxs-x64-d-vc.exe kernel32.lib gdi32.lib dxguid.lib dinput8.lib user32.lib ComCtl32.lib obj\libzxs-x64-d-vc\libzxs.obj obj\libzxs-x64-d-vc\main.obj obj\libzxs-x64-d-vc\src\dirent.obj obj\libzxs-x64-d-vc\src\zxs\acs.obj obj\libzxs-x64-d-vc\src\zxs\fso.obj obj\libzxs-x64-d-vc\src\zxs\wcs.obj  /DEBUG /machine:x64
obj\libzxs-x64-d-vc\libzxs.obj : fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'
Process terminated with status 1112 (0 minute(s), 2 second(s))
1 error(s), 0 warning(s) (0 minute(s), 2 second(s))
--- End code ---

stahta01:
Learn about your compiler!
Decide if you are doing 32 bit or 64 bit?

Then, do the right thing for that decision.

Link to the main option that should be set based on your  decision. http://msdn.microsoft.com/en-us/library/5wy54dk2.aspx

Edit2: I do NOT normally use MSVC; I found the above info in 15 minutes using Google.

Tim S.

awsdert:
Did you think I hadn't already tried that?
It ignored the /env and treated the x64 as a file, and I already have /MACHINE:X64 in the linker options.
Please at least look at the project file before you reply, I do not appreciate being treated like an idiot.

Edit: On another note you should have seen in the output that I have actually looked into those compiler settings which is making me think you're not worth listening to. If you are just gonna be lazy about it then don't bother I'd rather have replies from someone who is actually gonna try to help.

stahta01:

--- Code: ---/IC:\p\MSVS-x86\VC\include

--- End code ---

And, please stop and think You are compiling x86 stuff and trying to link x64 bit stuff.
Please learn to read!!!!!!!!!!!

Tim S.

awsdert:
if you can find a 64bit visual studio then please post a link otherwise go bug someone else as you clearly do not understand what you are talking about.

Edit: BTW with header files it does NOT matter about the path but rather what code is placed in those headers (which BTW is all TEXT to be compiled)

Navigation

[0] Message Index

[#] Next page

Go to full version