Qmake shows can‘t find --lQtCore

25 Views Asked by At

I'm new to qmake,I try to use qmake to generate Makefile, which is simple project owns three files "hello.c" "hello.h" and "main.c", I Write .pro like this

SOURCES += hello.c
SOURCES += main.c
CONFIG += console
HEADERS += hello.h

TARGET = helloworld


QT -= gui

when I make it, it shows an error:

Can't find -lQtCore

After I refer to this text I try "ld -lQtCore --verbose" and get this in return:

attempt to open //usr/x86_64-redhat-linux/lib64/libQtCore.so failed
attempt to open //usr/x86_64-redhat-linux/lib64/libQtCore.a failed
attempt to open //usr/lib64/libQtCore.so succeeded
-lQtCore (//usr/lib64/libQtCore.so)
libpthread.so.0 needed by //usr/lib64/libQtCore.so
found libpthread.so.0 at //usr/lib64/libpthread.so.0
libz.so.1 needed by //usr/lib64/libQtCore.so
found libz.so.1 at //usr/lib64/libz.so.1
libdl.so.2 needed by //usr/lib64/libQtCore.so
found libdl.so.2 at //usr/lib64/libdl.so.2
libgthread-2.0.so.0 needed by //usr/lib64/libQtCore.so
found libgthread-2.0.so.0 at //usr/lib64/libgthread-2.0.so.0
libglib-2.0.so.0 needed by //usr/lib64/libQtCore.so
found libglib-2.0.so.0 at //usr/lib64/libglib-2.0.so.0
librt.so.1 needed by //usr/lib64/libQtCore.so
found librt.so.1 at //usr/lib64/librt.so.1
libstdc++.so.6 needed by //usr/lib64/libQtCore.so
found libstdc++.so.6 at //usr/lib64/libstdc++.so.6
libm.so.6 needed by //usr/lib64/libQtCore.so
found libm.so.6 at //usr/lib64/libm.so.6
libgcc_s.so.1 needed by //usr/lib64/libQtCore.so
found libgcc_s.so.1 at //usr/lib64/libgcc_s.so.1
libc.so.6 needed by //usr/lib64/libQtCore.so
found libc.so.6 at //usr/lib64/libc.so.6
ld-linux-x86-64.so.2 needed by //usr/lib64/libQtCore.so
found ld-linux-x86-64.so.2 at //usr/lib64/ld-linux-x86-64.so.2
libpcre.so.1 needed by //usr/lib64/libgthread-2.0.so.0
found libpcre.so.1 at //usr/lib64/libpcre.so.1
ld: warning: cannot find entry symbol _start; not setting start address

I added INCLUDEPATH += /usr/lib64 to the .pro file, seems it doesn't work, what's the problem?

0

There are 0 best solutions below