Hi all:
Qt statically build program is fail.
libQt5Core.a depend on libpcre16
libQt5Gui.a depend on -lopengl32, -lglu32
What do I?
Here is my configuration and compilation:
Qt5.5.1 statically compiled, my configure:
./configure -opensource -confirm-license -nomake examples -nomake tests
-no-compile-examples -no-sql-sqlite -no-sql-odbc -skip qtdoc -skip
qtwebkit-examples -prefix
/d/source/rabbitim/ThirdLibary/build_script/../windows_mingw_static/qt -I
/d/source/rabbitim/ThirdLibary/build_script/../windows_mingw_static/include -L
/d/source/rabbitim/ThirdLibary/build_script/../windows_mingw_static/lib -static
-skip qt3d -skip qtcanvas3d -skip qtserialport -skip qtenginio -skip qtqa -skip
qtscript -skip qtwayland -skip qtconnectivity -skip qtgraphicaleffects -skip
qtimageformats -platform win32-g++ -skip qtandroidextras -skip qtx11extras
-skip qtmacextras -no-rpath -verbose
Ok. It compiled successfully.
Then build my program(https://github.com/KangLin/rabbitim/tree/Develop). My
program with cmake.
The CMakefiles
file(https://github.com/KangLin/rabbitim/blob/Develop/CMakeLists.txt):
SET(QT_COMPONENTS Core Gui Widgets Network Xml Multimedia)
FOREACH(_COMPONENT ${QT_COMPONENTS})
FIND_PACKAGE(Qt5${_COMPONENT} REQUIRED)
SET(QT_LIBRARIES ${QT_LIBRARIES} ${Qt5${_COMPONENT}_LIBRARIES})
ENDFOREACH()
SET(RABBITIM_LIBS
${RABBITIM_LIBS}
${QXMPP_LIBRARIES}
${OpenCV_LIBS}
${FFMPEG_LIBRARIES}
${VPX_LIBRARIES}
${SPEEX_LIBRARIES}
${CURL_LIBRARIES}
${OPENSSL_LIBRARIES}
${QT_LIBRARIES}
)
add_executable(${PROJECT_NAME} WIN32
${RABBITIM_SOURCES}
${RABBITIM_RCC_FILES}
${RABBITIM_UIS}
)
target_link_libraries(${PROJECT_NAME}
${RABBITIM_LIBS}
)
My configure:
cmake .. -G"MSYS Makefiles" -DCMAKE_BUILD_TYPE=Release
-DQt5_DIR=/d/source/rabbitim/ThirdLibary/build_script/../windows_mingw_static/qt/lib/cmake/Qt5
-DCMAKE_VERBOSE_MAKEFILE=TRUE -DOPTION_RABBITIM_USE_STATIC=ON
cmake --build . --config Release
Error message:
/D/msys32/mingw32/bin/g++.exe -std=c++0x -Wno-deprecated -Wextra
-Woverloaded-virtual -Winit-self -Wmissing-include-dirs -Wunused
-Wno-div-by-zero -Wundef -Wpointer-arith -Wmissing-noreturn -Werror=return-type
-std=c++0x -Wunused-but-set-variable -Wlogical-op -Wsizeof-pointer-memaccess
-Wreorder -Wformat -Wformat-security -fpermissive -O3 -DNDEBUG -static
-Wl,-subsystem,windows -mwindows -Wl,--whole-archive
CMakeFiles/RabbitIm.dir/objects.a -Wl,--no-whole-archive -o RabbitIm.exe
-Wl,--major-image-version,0,--minor-image-version,0
-L/D/source/rabbitim/ThirdLibary/windows_mingw_static/lib -lqxmpp -lavcodec
-lavicap32 -lgdi32 -lpsapi -lole32 -lstrmiids -luuid -loleaut32 -lshlwapi
-lws2_32 -liconv -lx264 -lpthread -lm -llzma -lbz2 -lz -lpsapi -ladvapi32
-lshell32 -lswresample -lm -lavutil -lm -lavformat -lavicap32 -lgdi32 -lpsapi
-lole32 -lstrmiids -luuid -loleaut32 -lshlwapi -lws2_32 -liconv -lx264
-lpthread -lm -llzma -lbz2 -lz -lpsapi -ladvapi32 -lshell32 -lavcodec
-lavicap32 -lgdi32 -lpsapi -lole32 -lstrmiids -luuid -loleaut32 -lshlwapi
-lws2_32 -liconv -lx264 -lpthread -lm -llzma -lbz2 -lz -lpsapi -ladvapi32
-lshell32 -lswresample -lm -lavutil -lm -lavutil -lm -lswscale -lm -lavutil -lm
-lvpx -lm -lcurl -lcurl -lssh2 -lssl -lcrypto -lssl -lcrypto -lwldap32 -lz
-lws2_32 -lgdi32 -lssl -lws2_32 -lgdi32 -lcrypt32 -lcrypto -lws2_32 -lgdi32
-lcrypt32 ../ThirdLibary/windows_mingw_static/qt/lib/libQt5Core.a
../ThirdLibary/windows_mingw_static/qt/lib/libQt5Gui.a
../ThirdLibary/windows_mingw_static/qt/lib/libQt5Widgets.a
../ThirdLibary/windows_mingw_static/qt/lib/libQt5Network.a
../ThirdLibary/windows_mingw_static/qt/lib/libQt5Xml.a
../ThirdLibary/windows_mingw_static/qt/lib/libQt5Multimedia.a
../ThirdLibary/windows_mingw_static/qt/lib/libQt5Positioning.a
../ThirdLibary/windows_mingw_static/qt/lib/libQt5QuickWidgets.a -lavcodec
-lavicap32 -lpsapi -lole32 -lstrmiids -luuid -loleaut32 -lshlwapi -liconv
-lx264 -lpthread -lm -llzma -lbz2 -lz -ladvapi32 -lshell32 -lswresample
-lavutil -lavformat -lswscale -lvpx -lcurl -lssh2 -lssl -lwldap32
../ThirdLibary/windows_mingw_static/qt/lib/libQt5Widgets.a
../ThirdLibary/windows_mingw_static/qt/lib/libQt5Quick.a
../ThirdLibary/windows_mingw_static/qt/lib/libQt5Gui.a
../ThirdLibary/windows_mingw_static/qt/lib/libQt5Qml.a
../ThirdLibary/windows_mingw_static/qt/lib/libQt5Network.a
../ThirdLibary/windows_mingw_static/qt/lib/libQt5Core.a
../ThirdLibary/windows_mingw_static/qt/lib/libqtmain.a -lkernel32 -luser32
-lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32
../ThirdLibary/windows_mingw_static/qt/lib/libQt5Core.a(qregularexpression.o):qregularexpression.cpp:(.text+0x261):
undefined reference to `pcre16_exec'
../ThirdLibary/windows_mingw_static/qt/lib/libQt5Core.a(qregularexpression.o):qregularexpression.cpp:(.text+0x2c6):
undefined reference to `pcre16_jit_