Koopa
Koopa

Reputation: 272

Qt C++ - Can't compile after switching to 64-bit

Recently, I realized that I was running a 32-bit version of Ubuntu, even though my computer was capable of 64-bit, so I upgraded from 12.10(?) 32 bit to 15.10 64 bit.

Qt did not like this at all. When compiling any project, I would get this:

error: fatal error: bits/c++config.h: No such file or directory compilation terminated.

I fixed this with:

sudo apt-get install gcc-multilib g++-multilib

, but now I get

error while loading shared libraries: libQt5Widgets.so.5: wrong ELF class: ELFCLASS64

After some research, I found that that's the result of compiling a 32-bit program on 64-bit libraries.

I'm not trying to cross-compile from 32 to 64, I just want to compile it on my computer.

Upvotes: 1

Views: 311

Answers (1)

Koopa
Koopa

Reputation: 272

I figured it out, thanks to NathanOliver and Mats Petersson (thanks!).

What I did was I went into the Projects tab on the right, and clicked Manage kits at the top.

Screenshot In the kits tab, select the default configuration, and then look at the compiler combo-box. Make sure that you select a 64-bit compiler, and not a 32-bit one.

Now, rebuild all, clean all, and run qmake in the Build tab of the menu bar, and you should be able to compile your program.

Upvotes: 2

Related Questions