Linker Error on 64bit machine

411 views
Skip to first unread message

EJ

unread,
Oct 24, 2011, 4:00:52 PM10/24/11
to Google C++ Testing Framework
I see other people having this problem when I search the internet for
solutions, but no one ever gives them answers that help me. Here is my
problem. I'm using VS2005. I used it to build the google test files.
The target machine is x86 and I build them for Debug and Release x64
configuration (I also tried Win32 and STILL had the problem I'm about
to explain).

Now in the solution with the files I'm trying to test, I wrote a
simple test with TEST just to see if it would work and in my main loop
I call RUN_ALL_TESTS(). I include gtest.h and link with gtestd.lib
(I'm only testing the debug version at this time). The target machine
for this solution is set to x86 for the current configuration (debug)
and platform (I've tried win32, x64, and Mixed Platforms, the last of
which is not available when I try to build google test).

When I try to build my solution, I receive ONLY one error. A linker
error that reads like so:
gtestd.lib(gtest-all.obj) : fatal error LNK1112: module machine type
'x64' conflicts with target machine type 'X86'

When I try to change the target machine in my solution, I receive the
same error, but with x64 and X86 switched.

How on earth do I fix this? I've tried every combination of
configurations and target machines I can think of? Also, the program
builds, links, and runs just fine when I don't have any tests or
references to google test, so this is definitely just a google test
issue I'm having. Anyone have any ideas on what I can do to fix this?

Greg Miller

unread,
Oct 26, 2011, 10:05:01 AM10/26/11
to EJ, Google C++ Testing Framework
Hello, EJ.

Sorry this reply was so delayed, but I was waiting for someone who might actually know the answer to chime in. I don't have a Windows machine with VS2005 nearby. I thought I'd make sure you saw this MSDN page that talks about the error you're seeing. Have you tried what it mentions?

Greg

Greg Miller

unread,
Oct 26, 2011, 10:09:35 AM10/26/11
to EJ, Google C++ Testing Framework
Additionally, the GoogleTest FAQ has some comments on usage with Visual Studio and some links to other articles that might be helpful.

Greg
Reply all
Reply to author
Forward
0 new messages