undefined symbol: qMain
eddiezato opened this issue · 3 comments
eddiezato commented
Try to build on msys2/clang64 with qt 6.5.0 and get an error:
Cloning into 'qt-jpegxl-image-plugin'...
remote: Enumerating objects: 36, done.
remote: Counting objects: 100% (36/36), done.
remote: Compressing objects: 100% (35/35), done.
remote: Total 36 (delta 2), reused 20 (delta 0), pack-reused 0
Receiving objects: 100% (36/36), 3.35 MiB | 1.99 MiB/s, done.
Resolving deltas: 100% (2/2), done.
D:/msys2/home/Gautama/yacr/qt-jpegxl-image-plugin/.qmake.conf:1: Cannot find feature qt_build_config
D:/msys2/home/Gautama/yacr/qt-jpegxl-image-plugin/.qmake.conf:1: Cannot find feature qt_build_config
Info: creating stash file D:\msys2\home\Gautama\yacr\qt-jpegxl-image-plugin\.qmake.stash
D:/msys2/home/Gautama/yacr/qt-jpegxl-image-plugin/qt-jpegxl-image-plugin.pro:13: Cannot find feature qt_plugin
clang++ -c -flto=thin -ffunction-sections -fdata-sections -march=native -mtune=native -O3 -pipe -O3 -Wall -Wextra -Wextra -Wno-ignored-attributes -fexceptions -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I. -I/home/Gautama/yacr/install/include -ID:/msys2/clang64/include/qt6 -ID:/msys2/clang64/include/qt6/QtGui -ID:/msys2/clang64/include/qt6/QtCore -I. -I/include -ID:/msys2/clang64/share/qt6/mkspecs/win32-clang-g++ -o qjpegxlhandler.o src/qjpegxlhandler.cpp
clang++ -flto=thin -ffunction-sections -fdata-sections -march=native -mtune=native -O3 -pipe -O3 -Wall -Wextra -Wextra -Wno-ignored-attributes -dM -E -o moc_predefs.h D:/msys2/clang64/share/qt6/mkspecs/features/data/dummy.cpp
'D:\msys2\clang64\share\qt6\bin\moc.exe' -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN --include D:/msys2/home/Gautama/yacr/qt-jpegxl-image-plugin/moc_predefs.h -ID:/msys2/clang64/share/qt6/mkspecs/win32-clang-g++ -ID:/msys2/home/Gautama/yacr/qt-jpegxl-image-plugin -ID:/home/Gautama/yacr/install/include -ID:/msys2/clang64/include/qt6 -ID:/msys2/clang64/include/qt6/QtGui -ID:/msys2/clang64/include/qt6/QtCore -ID:/msys2/clang64/include/c++/v1 -ID:/msys2/clang64/lib/clang/16/include -ID:/msys2/clang64/include src/main.cpp -o main.moc
clang++ -c -flto=thin -ffunction-sections -fdata-sections -march=native -mtune=native -O3 -pipe -O3 -Wall -Wextra -Wextra -Wno-ignored-attributes -fexceptions -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I. -I/home/Gautama/yacr/install/include -ID:/msys2/clang64/include/qt6 -ID:/msys2/clang64/include/qt6/QtGui -ID:/msys2/clang64/include/qt6/QtCore -I. -I/include -ID:/msys2/clang64/share/qt6/mkspecs/win32-clang-g++ -o main.o src/main.cpp
clang++ -flto=thin -Wl,--gc-sections -Wl,-s -Wl,-subsystem,windows -o qjpegxl.exe qjpegxlhandler.o main.o -L/home/Gautama/yacr/install/lib -ljxl -ljxl_threads -lbrotlicommon -lbrotlienc -lbrotlidec D:/msys2/clang64/lib/libQt6Gui.dll.a D:/msys2/clang64/lib/libQt6Core.dll.a -lmingw32 D:/msys2/clang64/lib/libQt6EntryPoint.a -lshell32
ld.lld: error: undefined symbol: qMain(int, char**)
>>> referenced by libQt6EntryPoint.a(qtentrypoint_win.cpp.obj):(qtEntryPoint())
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Makefile:73: qjpegxl.exe] Error 1
Any suggestions?
novomesk commented
These messages:
Cannot find feature qt_build_config
Cannot find feature qt_plugin
mean that something is missing in the Qt installation.
However, I don't know whether it is just incomplete installation or it was removed intentionally in the new version.
eddiezato commented
Tried to build with cmake instead of qmake-qt6. It worked.
eddiezato commented
Since I was able to build with cmake and it's more convenient method for me, I think I'll close this issue as irrelevant.