我想将 LEMUR 库与 QT 一起使用,但我需要一些帮助。我那里有说明:说明
makeFile.app 包含:
# compiling C++ code
%.o: %.cpp
$(CXX) $(CXXFLAGS) -o $@ -c $<
%: %.o
$(CXX) $(CXXFLAGS) -o $@ $< $(CPPLDFLAGS)
prefix = /usr/local
exec_prefix = ${prefix}
INC = ${prefix}/include
#antlr is already set up properly for include path
LIBPATH = ${exec_prefix}/lib
LIB = lemur
CXX = g++
CFLAGS = -DPACKAGE_NAME=\"Lemur\" -DPACKAGE_TARNAME=\"lemur\" -DPACKAGE_VERSION=\"4.12\" -DPACKAGE_STRING=\"Lemur\ 4.12\" -DPACKAGE_BUGREPORT=\"project@lemurproject.org\" -DHAVE_LIBM=1 -DHAVE_LIBPTHREAD=1 -DHAVE_LIBZ=1 -DHAVE_NAMESPACES= -DISNAN_IN_NAMESPACE_STD= -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FSEEKO=1 -DHAVE_MKSTEMP=1 -DHAVE_MKSTEMPS=1 -DHAVE_EXT_ATOMICITY_H=1 -DP_NEEDS_GNU_CXX_NAMESPACE=1 -DNDEBUG=1 -g -O3 -I$(INC)
CXXFLAGS = -DPACKAGE_NAME=\"Lemur\" -DPACKAGE_TARNAME=\"lemur\" -DPACKAGE_VERSION=\"4.12\" -DPACKAGE_STRING=\"Lemur\ 4.12\" -DPACKAGE_BUGREPORT=\"project@lemurproject.org\" -DHAVE_LIBM=1 -DHAVE_LIBPTHREAD=1 -DHAVE_LIBZ=1 -DHAVE_NAMESPACES= -DISNAN_IN_NAMESPACE_STD= -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FSEEKO=1 -DHAVE_MKSTEMP=1 -DHAVE_MKSTEMPS=1 -DHAVE_EXT_ATOMICITY_H=1 -DP_NEEDS_GNU_CXX_NAMESPACE=1 -DNDEBUG=1 -g -O3 -I$(INC)
CPPLDFLAGS = -L$(LIBPATH) -l$(LIB) -lz -lpthread -lm
## specify your object files here
OBJS = main.cpp
## specify your program here
PROG = Qt4
all: $(PROG)
$(PROG): $(OBJS)
$(CXX) $(CXXFLAGS) -o $@ $^ $(CPPLDFLAGS)
clean:
rm $(PROG) $(OBJS)
最后我写了 QT4 作为我的程序和 main.cpp 作为我的对象,但它不起作用。当我运行 make -f MakeFile.app 时,我的终端出现错误
main.cpp:1:35:致命错误:QtCore/QCoreApplication:没有关于这种类型的文件或文件夹
如果我使用带有 QT 的构建按钮进行编译,则会出现此错误:
In file included from /usr/local/include/indri/ref_ptr.hpp:21:0,
from /usr/local/include/indri/Repository.hpp:26,
from /usr/local/include/LemurIndriIndex.hpp:25,
from ../CBIRTest/main.cpp:9:
/usr/local/include/indri/atomic.hpp: In function 'void indri::atomic::increment(indri::atomic::value_type&)':
/usr/local/include/indri/atomic.hpp:51:33: error: '__atomic_add' was not declared in this scope
/usr/local/include/indri/atomic.hpp:51:33: note: suggested alternative:
/usr/include/c++/4.6/ext/atomicity.h:51:3: note: '__gnu_cxx::__atomic_add'
/usr/local/include/indri/atomic.hpp: In function 'void indri::atomic::decrement(indri::atomic::value_type&)':
/usr/local/include/indri/atomic.hpp:55:35: error: '__atomic_add' was not declared in this scope
/usr/local/include/indri/atomic.hpp:55:35: note: suggested alternative:
/usr/include/c++/4.6/ext/atomicity.h:51:3: note: '__gnu_cxx::__atomic_add'
在我的 QT 项目中,我只有一个 .pro 文件和 main.cpp 在我的 .pro 文件中,我有库和路径
INCLUDEPATH += I/usr/local/include/ \
LIBS += -L/usr/local/lib \
主文件
#include <QtCore/QCoreApplication>
#include "opencv2/calib3d/calib3d.hpp"
#include "opencv2/core/core.hpp"
#include "opencv2/features2d/features2d.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/nonfree/features2d.hpp"
#include "opencv2/nonfree/nonfree.hpp"
#include "lemur-compat.hpp"
#include "LemurIndriIndex.hpp"
#include "lemur-platform.h"
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
return a.exec();
}
任何人都可以帮助我吗?
感谢