我正在编写一个使用我同时开发的另一个库的应用程序。这会产生问题,QtCreator 将期望库永远不会更改到删除的标头导致构建项目失败的地步,并且即使新类可以很好地编译到库中,它们也会被报告为未定义。这是怎么回事?就好像它实际上并没有在看图书馆。有什么办法可以强制它让我使用库中的新添加内容?
这是应用程序.pro
QT += core gui opengl
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = BlockEditor
TEMPLATE = app
SOURCES += main.cpp\
mainwindow.cpp \
openglqt.cpp \
tilelabel.cpp
HEADERS += mainwindow.h \
openglqt.h \
tilelabel.h
FORMS += mainwindow.ui
LIBS += -L/usr/local/lib -lGLU -lGLEW
QMAKE_LFLAGS += -Wl,--rpath=\\\$\$ORIGIN/libs
QMAKE_RPATH=
release {
LIBS += -L$$PWD/../drEngine/bin/Release/ -ldrEngine
}
debug {
LIBS += -L$$PWD/../drEngine/bin/Debug/ -ldrEngine
}
INCLUDEPATH += $$PWD/../drEngine
DEPENDPATH += $$PWD/../drEngine
QMAKE_CXXFLAGS += -std=c++11
该库是在 Code::Blocks 中开发的
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="Dark Realms Engine" />
<Option pch_mode="2" />
<Option compiler="gcc" />
<Build>
<Target title="Debug">
<Option output="bin/Debug/drEngine" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/Debug/" />
<Option type="3" />
<Option compiler="gcc" />
<Option createDefFile="1" />
<Option createStaticLib="1" />
<Compiler>
<Add option="-g" />
</Compiler>
</Target>
<Target title="Release">
<Option output="bin/Release/drEngine" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/Release/" />
<Option type="3" />
<Option compiler="gcc" />
<Option createDefFile="1" />
<Option createStaticLib="1" />
<Compiler>
<Add option="-O3" />
</Compiler>
<Linker>
<Add option="-s" />
</Linker>
</Target>
</Build>
<Compiler>
<Add option="-std=c++11" />
<Add option="-Wall" />
</Compiler>
<Unit filename="Block.cpp" />
<Unit filename="Block.hpp" />
<Unit filename="BlockList.cpp" />
<Unit filename="BlockList.hpp" />
<Unit filename="Camera2D.cpp" />
<Unit filename="Camera2D.hpp" />
<Unit filename="Camera3D.cpp" />
<Unit filename="Camera3D.hpp" />
<Unit filename="Entity.hpp" />
<Unit filename="Includes.hpp" />
<Unit filename="RenderInfo.cpp" />
<Unit filename="RenderInfo.hpp" />
<Unit filename="Renderer.cpp" />
<Unit filename="Renderer.hpp" />
<Unit filename="Scene.cpp" />
<Unit filename="Scene.hpp" />
<Unit filename="TextureAtlas.cpp" />
<Unit filename="TextureAtlas.hpp" />
<Unit filename="dr.hpp" />
<Unit filename="isoMap.cpp" />
<Unit filename="isoMap.hpp" />
<Extensions>
<envvars />
<code_completion />
<lib_finder disable_auto="1" />
<debugger />
<DoxyBlocks>
<comment_style block="0" line="0" />
<doxyfile_project />
<doxyfile_build />
<doxyfile_warnings />
<doxyfile_output />
<doxyfile_dot />
<general />
</DoxyBlocks>
</Extensions>
</Project>
</CodeBlocks_project_file>