junnel
junnel

Reputation: 11

undefined reference to `QApplication::QApplication(int&, char**, int)'

I'm cross compiling Qt program to U-touch using arm-poky-linux-gnueabi-gcc. When I execute the following command, I get the error message below:

arm-poky-linux-gnueabi-gcc -o try main.cpp -I/usr/include/qt4 -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtCore -lQtCore -lQtGui

Error Message:

/opt/poky/1.2.1/sysroots/i686-pokysdk-linux/usr/libexec/armv7a-vfp-neon-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.6.4/ld: cannot find -lQtCore
/opt/poky/1.2.1/sysroots/i686-pokysdk-linux/usr/libexec/armv7a-vfp-neon-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.6.4/ld: cannot find -lQtGui

What am I doing wrong?

Upvotes: 0

Views: 3181

Answers (1)

Claudio
Claudio

Reputation: 10947

The compiler (or better, the linker) cannot find a copy of the libraries to link to.

Solution:

  1. Put a copy of the Qt libraries for the target on the host.
  2. Then, provide their path to gcc with the -L /path/ option.

Upvotes: 1

Related Questions