簡體   English   中英

在Windows上編譯靜態Qt構建時未定義的引用

[英]Undefined references when compiling a static Qt build on Windows

我想在Windows平台(Windows XP SP3)上編譯Qt工具包的靜態版本。 我下載了Windows的最新版本並成功安裝了它。 然后,從“開始”菜單中打開Qt 4.6.3命令提示符並調用:

configure -static -release -nomake examples -nomake demos -fast

配置執行良好,並且mingw32-make的第一部分也是如此。 在某個時候,我得到了很多未定義的引用:

mingw32-make [4]:進入目錄“ C:/Qt-static/4.6.3/src/tools/moc”
克++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_MOC -DQT_BOOTSTRAPPED -DQT_LITE_UNICODE -DQT_TEXTCODEC -DQT_NO_CAST_FROM_AS CII -DQT_NO_CAST_TO_ASCII -DQT_NO_CODECS -DQT_NO_DATASTREAM -DQT_NO_GEOM_VARIANT -DQT_NO_LIBRARY -DQT_NO_QOBJECT -DQT_NO_STL -DQT_NO_SYSTEMLOCALE -DQT_NO_TEXTST REAM -DQT_NO_THREAD - DQT_NO_UNICODETABLES -DQT_NO_USING_NAMESPACE -DQT_NODLL -I“。 -一世”。” -I“ ...... \\ include” -I“ ...... \\ include \\ QtCore” -I“ ...... \\ include \\ Qt Xml” -I“ .... \\ xml “ -I” c:\\ Program Files \\ Microsoft Visual Studio .NET 2003 \\ SDK \\v1。1\\ include“ -I” ...... \\ mkspecs \\ win32-g ++“ -o release \\ moc.o moc。 cpp

...

g ++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-rel oc -Wl,-s -Wl,-subsystem,console -mthreads -Wl -o .... .. \\ bin \\ moc.exe版本/ m oc.o版本/preprocessor.o版本/generator.o版本/parser.o版本/token.o版本/main.o -L“ c:\\ Program Files \\ Microsoft Visual Studio .NET 2003 \\ SDK \\ v1.1 \\ Lib \\“ -LC:/Qt-static/4.6.3/src/tools/bootstrap/release -lbootstrap -luser32 release / moc.o:moc.cpp :(。text + 0x14b):對QByteArray::shared_ null'
release/moc.o:moc.cpp:(.text+0x150): undefined reference to
未定義引用
QByteArray::shared_ null'
release/moc.o:moc.cpp:(.text+0x150): undefined reference to
QByteArray::shared_ null'
release/moc.o:moc.cpp:(.text+0x150): undefined reference to
QByteArray :: shared_ null的QByteArray::shared_ null'
release/moc.o:moc.cpp:(.text+0x150): undefined reference to

release / moc.o:moc.cpp :(。text + 0x156):對`QByteArray :: shared_的未定義引用

...

未定義引用的列表實際上更長。

在非常默認的Windows安裝中,這是開箱即用的。 我想知道我做錯了什么還是工具包中有錯誤。

我有類似的問題。 就我而言,Visual Studio設置了環境參數
INCLUDELIB混淆了品牌。

解決方案是從命令行禁用它們

set INCLUDE=
set LIB=

在編譯Qt庫之前。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM