[Resolved]qmake i386 vs i386:x86-64
I've recently upgraded my system to ubuntu 12.04 based Mint 13 KDE 64 bit, and I'm trying to test out qmake by compiling a c++ file via 'alphaPlusConnector.pro' (which I've successfully done on a past system) issuing these commands:
$ qmake -o Makefile ./alphaPlusConnector.pro
and after 'make' I'm getting this error:
g++ -m64 -Wl,-O1 -o alphaPlusConnector alphaPlusConnector.o -L/usr/lib/x86_64-linux-gnu -lmysqlpp -lQtGui -lQtCore -lpthread
/usr/bin/ld: i386 architecture of input file `alphaPlusConnector.o' is incompatible with i386:x86-64 output
collect2: ld returned 1 exit status
make: *** [alphaPlusConnector] Error 1
How can I remedy this issue?
Have you rebuilt the alphaPlusConnector.o with your current compiler, or did you only link the old object (from your past system)?
I re-ran qmake on 'alphaPlusConnector.pro' on the current system. I assume this rebuilt alphaPlusConnector.o?
check if the qmake is 32bit or 64bit(just a wild guess, i m a windows user)
bq. I assume this rebuilt alphaPlusConnector.o?’
qmake only rebuilds the makefiles. The *.o files are the output of your compiler. After invoking qmake you have to run
- mingw32-make clean
- and then mingw32-make
in order to rebuild everything.
mingw32? Isn't that for making windows programs?
Yes, it is. I am a windows user as well. Did you try to rebuild the sourcecode? You have to use make I guess. :-)
but make is where I'm having the problem, it wont let me run make without errors.
bq. I re-ran qmake on ‘alphaPlusConnector.pro’ on the current system. I assume this rebuilt alphaPlusConnector.o?
I would have guessed that you used an old build where the objects were already created by the older 32bit compiler. Now you are using the new 64bit tools, but the old objectfile still remains with its old timestamp in its old 32bit form. So make doesn't see the need for rebuilding the objectfiles.
make clean will remove the old objectfiles and
make will recompile the old files and link everything together.
qmake does not compile anything but the .pro file into makefiles (and some other things with ui files).
Got it, PEBKAC.
You were close to right with the problem, franku.
Thanks for the replies, appreciate the help.