Author Topic: Linker target messsed up on single file  (Read 21867 times)

Offline awsdert

  • Multiple posting newcomer
  • *
  • Posts: 28
Linker target messsed up on single file
« on: April 01, 2014, 07:21:34 pm »
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))

Online stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Linker target messsed up on single file
« Reply #1 on: April 01, 2014, 07:45:22 pm »
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.
« Last Edit: April 01, 2014, 07:51:02 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline awsdert

  • Multiple posting newcomer
  • *
  • Posts: 28
Re: Linker target messsed up on single file
« Reply #2 on: April 01, 2014, 08:03:04 pm »
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.
« Last Edit: April 01, 2014, 08:11:18 pm by awsdert »

Online stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Linker target messsed up on single file
« Reply #3 on: April 01, 2014, 08:12:35 pm »
Code
/IC:\p\MSVS-x86\VC\include

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

Tim S.
« Last Edit: April 01, 2014, 08:14:41 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline awsdert

  • Multiple posting newcomer
  • *
  • Posts: 28
Re: Linker target messsed up on single file
« Reply #4 on: April 01, 2014, 08:18:33 pm »
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)
« Last Edit: April 01, 2014, 08:21:46 pm by awsdert »

Online stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Linker target messsed up on single file
« Reply #5 on: April 01, 2014, 08:20:34 pm »
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.

I am going to ask you be banned for violating the rules.
Edit: Decided to let someone else ask you to be banned for violating the rules http://forums.codeblocks.org/index.php/topic,9996.0.html
Changed my mind; you really need to read the rules!

Bye

Tim S.
« Last Edit: April 01, 2014, 08:25:21 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline awsdert

  • Multiple posting newcomer
  • *
  • Posts: 28
Re: Linker target messsed up on single file
« Reply #6 on: April 01, 2014, 08:23:27 pm »
I have just reported you as a troll since you do not actually understand a thing in this thread

Online stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Linker target messsed up on single file
« Reply #7 on: April 01, 2014, 08:26:59 pm »
I have just reported you as a troll since you do not actually understand a thing in this thread

I do understand you ARE not asking a CB question; but, a compiler question.
You are likely to be banned.

http://www.catb.org/esr/faqs/smart-questions.html

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline awsdert

  • Multiple posting newcomer
  • *
  • Posts: 28
Re: Linker target messsed up on single file
« Reply #8 on: April 01, 2014, 08:30:32 pm »
This is a CONFIGURATION question, if you re-read the post then you will understand WHY I have posted it here in the first place.
I HAVE read those rules and still posted here BECAUSE I believe something is wrong with the *.CBP file, if you cannot understand that then keep OUT of this thread.

Online stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Linker target messsed up on single file
« Reply #9 on: April 01, 2014, 08:35:53 pm »
This is a CONFIGURATION question, if you re-read the post then you will understand WHY I have posted it here in the first place.
I HAVE read those rules and still posted here BECAUSE I believe something is wrong with the *.CBP file, if you cannot understand that then keep OUT of this thread.

What option are you trying to add!!!!!!!

If you state an option and ask how to add it it is a CB question.
If you have no idea what Compiler/Linker option it is off topic.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline awsdert

  • Multiple posting newcomer
  • *
  • Posts: 28
Re: Linker target messsed up on single file
« Reply #10 on: April 01, 2014, 08:54:09 pm »
I have tried all the easy to find linker stuff and compiler stuff, I have also set the compiler search to directories to locate only 64bit libs so the only thing I can think of is that it is has something to do with individual file settings in the project file as some files compile fine while others don't even though they should all have the SAME settings as I removed all the extra that CB put in to ensure it sticks to just the target settings. Please at least look at the output and the project file so that you SEE that I have done all I can before posting this here.

As a side note all my code is done in just ANSI C so it should not be a compiler problem and based off of the documentation MS provides the /machine:x64 was the only additional option I had to set for VC2013 to understand that it should be using 64bit based code. If you haven't already noticed no other file before it produces that issue even though they rely on the same target settings hence why I think this is a cfg issue.

Online stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline awsdert

  • Multiple posting newcomer
  • *
  • Posts: 28
Re: Linker target messsed up on single file
« Reply #12 on: April 01, 2014, 09:17:57 pm »
Thank you that was much more helpful, solved my problem although it would've been sufficient for you to say something like "There was no issue that I could find in the project cfg, see if the toolchain executables are actually able to compile 64bit code", that would have been enough instead of you having to research something outside of this forums (for lack of a better word) requirements.

Online stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Linker target messsed up on single file
« Reply #13 on: April 01, 2014, 09:27:08 pm »
Thank you that was much more helpful, solved my problem although it would've been sufficient for you to say something like "There was no issue that I could find in the project cfg, see if the toolchain executables are actually able to compile 64bit code", that would have been enough instead of you having to research something outside of this forums (for lack of a better word) requirements.

WE DO NOT SUPPORT THE MSVC COMPILER!!!!!!!!!!!!!!
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline awsdert

  • Multiple posting newcomer
  • *
  • Posts: 28
Re: Linker target messsed up on single file
« Reply #14 on: April 01, 2014, 09:36:20 pm »
That's why I said it would have been sufficient to say "There was no issue that I could find in the project cfg, see if the toolchain executables are actually able to compile 64bit code", I did not ask you to solve the problem if it was not a cfg issue but rather check to see if it was a cfg issue or just me missing something in the documentation. I never expected you to research any compiler or linker stuff just to check whether something in xml was causing my problem, if you found an issue there then that's all I expected you to help me with. Anything further, while nice, was not within my expectations.