Question

Je suis en train d'utiliser CLucene-0.9.21b et libcue-1.3.0 dans Qt Creator sur Kubuntu Lucid. ce code est compilable :

project.pro

SOURCES += main.cpp
LIBS += -lcue
INCLUDEPATH += /usr/include/libcue-1.3/libcue

main.cpp

extern "C" {
 #include <libcue.h>
}
int main(int argc, char *argv[]) {
 return 0;
}

est donc cette :

project.pro

SOURCES += main.cpp
LIBS += -clucene

main.cpp

#include <CLucene.h>
int main(int argc, char *argv[]) {
 return 0;
}

mais pas celui-ci :

project.pro

SOURCES += main.cpp
LIBS += -lcue \
 -clucene
INCLUDEPATH += /usr/include/libcue-1.3/libcue

main.cpp

extern "C" {
 #include <libcue.h>
}
#include <CLucene.h>
int main(int argc, char *argv[]) {
 return 0;
}

ce dernier génère les erreurs suivantes:

Running build steps for project project...
Configuration unchanged, skipping QMake step.
Starting: /usr/bin/make -w 
make: Entering directory `/home/user/project/project'
/usr/bin/qmake-qt4 -spec /usr/share/qt4/mkspecs/linux-g++ -unix CONFIG+=debug -o Makefile project.pro
make: Leaving directory `/home/user/project/project'
make: Entering directory `/home/user/project/project'
g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I/usr/include/libcue-1.3/libcue -I. -o main.o main.cpp
In file included from /usr/include/sys/stat.h:107,
from /usr/include/CLucene/StdHeader.h:76,
from /usr/include/CLucene.h:11,
from main.cpp:5:
/usr/include/bits/stat.h:88: error: field ‘st_atim’ has incomplete type
/usr/include/bits/stat.h:89: error: field ‘st_mtim’ has incomplete type
/usr/include/bits/stat.h:90: error: field ‘st_ctim’ has incomplete type
/usr/include/bits/stat.h:149: error: field ‘st_atim’ has incomplete type
/usr/include/bits/stat.h:150: error: field ‘st_mtim’ has incomplete type
/usr/include/bits/stat.h:151: error: field ‘st_ctim’ has incomplete type
main.cpp:6: warning: unused parameter ‘argc’
main.cpp:6: warning: unused parameter ‘argv’
make: *** [main.o] Error 1
make: Leaving directory `/home/user/project/project'
Exited with code 2.
Error while building project project
When executing build step 'Make'

pourquoi est-ce et comment il faire le travail?

Était-ce utile?

La solution

Ok, cette fois, j'ai eu la chance d'essayer réellement. Problème semble être que libcue a un fichier appelé time.h dans son dossier comprennent. Donc, si vous compilez avec -I / usr / include / libcue-1.4 / libcue puis vous vous retrouvez avec le time.h de libcue au lieu de son libc.

Cela fonctionne pour moi:

extern "C" {
 #include <libcue/libcue.h>
}
#include <CLucene.h>

int main(int argc, char *argv[]) {
 return 0;
}

et la compilation de toute évidence avec -I / usr / include / libcue-1.4 / au lieu de -I / usr / include / libcue-1.4 / libcue

Autres conseils

Et si vous changez la queue et autour CLucene COMPREND? Il pourrait être un problème avec ordre comprennent et je soupçonne que le mélange c et c ++ peut faire comprendre l'ordre encore plus important

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top