views:

149

answers:

1

I'm trying to build a 64 bit version of my application (and yes I really do need the memory) on my 32bit xp dev box for production testing on our Vista64 server.

Previously, I have built w/o any errors the Qt 4.6.2 DLL's in 64 bit mode. That step went vary smooth.

Just to get started in building production, I'm trying to rebuild Qt's Star Delegate demo in 64bit mode. I converted the 32bit to 64bit app by changing the application configuration and adjusting the library's to the 64bit venisons. Now, when I go to link, I'm getting the following error when I link

1>------ Build started: Project: stardelegate, Configuration: Release x64 ------
1>Linking...
1>MSVCRT.lib(crtexew.obj) : error LNK2001: unresolved external symbol WinMain
1>release64\stardelegate.exe : fatal error LNK1120: 1 unresolved externals

Suggestions?

edit - After some more searching, discovered if I link as a console app it will work and run. But not as a windows app. And I don't have this problem in 32 bit mode.

+1  A: 

http://stackoverflow.com/questions/2176048/qt-application-64-bit-windows

Edit: Nevermind, you found it. You need to link against qtmain if you are not using CMake or qmake as stated here: http://doc.qt.nokia.com/4.6/modules.html.

You don't need to accept this as I didn't find it, but just so future people see the answer and don't get confused.

Adam W
Thanks for link, however, this is one problem we are not having. Our problem was related only to linking the 64bit app as we have already built the qt libaries in 64 bit mode.
photo_tom
@photo_tom: What does your linker path look like? As stated in that link (and hopefully is obvious) if you end up linking to the 32bit libraries with a 64bit build it will fail. Make sure the 32bit libraries do not come before the 64bit ones in your link path.
Adam W
@Adam w - You raise a valid point point about the link path that I had checked before I asked the question. Working in a mixed 32/64bit native code app world is definitely one where you really have to be organized in your builds. Definitely something that I have to work on. My problem turned out to be that I didn't know that I needed to include Qtmain.lib in the build.
photo_tom