[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: GCC version and missing undefined WinMain reference
From: |
Filippo Rusconi |
Subject: |
Re: GCC version and missing undefined WinMain reference |
Date: |
Thu, 2 Apr 2020 16:44:23 +0200 |
Greetings,
thank you to all the responders for kindly answering my question. I was not
aware
of this "upgrading" mechanism based on the notion of plugins.
I have a question, now that the build of my program goes as far as the link
step.
This program is a GUI program based on Qt5.
This is the way I configure the source tree using CMake so as to build a MinGW64
binary executable.
x86_64-w64-mingw32.shared-cmake -DCMAKE_BUILD_TYPE=Release ../development
Then I run
MXE_PLUGIN_DIRS='plugins/gcc8' make
And all the files are build, unless for the linkage step:
[100%] Linking CXX executable mineXpert2.exe
cd /home/rusconi/devel/msxpertsuite/minexpert2/build-area/src &&
/home/rusconi/devel/mxe/usr/x86_64-pc-linux-gnu/bin/cmake -E cmake_link_script
CMakeFiles/mineXpert2.dir/link.txt --verbose=1
/home/rusconi/devel/mxe/usr/x86_64-pc-linux-gnu/bin/cmake -E remove -f
CMakeFiles/mineXpert2.dir/objects.a
/home/rusconi/devel/mxe/usr/bin/x86_64-w64-mingw32.shared-ar cr
CMakeFiles/mineXpert2.dir/objects.a @CMakeFiles/mineXpert2.dir/objects1.rsp
/home/rusconi/devel/mxe/usr/x86_64-pc-linux-gnu/bin/x86_64-w64-mingw32.shared-g++
-fopenmp -L/home/rusconi/devel/libpappsomspp/build-area/src
-L/home/rusconi/devel/libpappsomspp/build-area/src/pappsomspp/widget -L/usr/lib
-g -Wl,--whole-archive CMakeFiles/mineXpert2.dir/objects.a
-Wl,--no-whole-archive -o mineXpert2.exe -Wl,--out-implib,libmineXpert2.dll.a
-Wl,--major-image-version,0,--minor-image-version,0
@CMakeFiles/mineXpert2.dir/linklibs.rsp
/home/rusconi/devel/mxe/usr/lib/gcc/x86_64-w64-mingw32.shared/5.5.0/../../../../x86_64-w64-mingw32.shared/lib/../lib/libmingw32.a(lib64_libmingw32_a-crt0_c.o):
In function `main':
/home/rusconi/devel/mxe/tmp-gcc-x86_64-w64-mingw32.shared/gcc-5.5.0.build_.crt/../gcc-5.5.0.build_/mingw-w64-v6.0.0/mingw-w64-crt/crt/crt0_c.c:18:
undefined reference to `WinMain'
collect2: error: ld returned 1 exit status
make[2]: *** [src/CMakeFiles/mineXpert2.dir/build.make:1635:
src/mineXpert2.exe] Error 1
make[2]: Leaving directory
'/home/rusconi/devel/msxpertsuite/minexpert2/build-area'
make[1]: *** [CMakeFiles/Makefile2:99: src/CMakeFiles/mineXpert2.dir/all] Error
2
make[1]: Leaving directory
'/home/rusconi/devel/msxpertsuite/minexpert2/build-area'
make: *** [Makefile:133: all] Error 2
I have looked into CMakeFiles/mineXpert2.dir/linklibs.rsp:
$ cat src/CMakeFiles/mineXpert2.dir/linklibs.rsp
/home/rusconi/devel/mxe/usr/x86_64-w64-mingw32.shared/qt5/lib/libQt5Xml.a /home/rusconi/devel/mxe/usr/x86_64-w64-mingw32.shared/qt5/lib/libQt5Svg.a /home/rusconi/devel/mxe/usr/x86_64-w64-mingw32.shared/qt5/lib/libQt5PrintSupport.a /home/rusconi/devel/qcustomplot/build-area/libqcustomplot.dll /home/rusconi/devel/custompwiz/build-area/src/libcustompwiz.dll /home/rusconi/devel/isospec/build-area/libIsoSpec++.dll /home/rusconi/devel/pappsomspp/build-area/src/libpappsomspp-qt5.dll /home/rusconi/devel/pappsomspp/build-area/src/pappsomspp/widget/libpappsomspp-widget-qt5.dll -lstdc++ /home/rusconi/devel/mxe/usr/x86_64-w64-mingw32.shared/qt5/lib/libQt5Widgets.a /home/rusconi/devel/mxe/usr/x86_64-w64-mingw32.shared/qt5/lib/libQt5Gui.a /home/rusconi/devel/mxe/usr/x86_64-w64-mingw32.shared/qt5/lib/libQt5Core.a -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32
I researched a bit about this undefined reference to WinMain error and I found a
lot of pages that mention various differing libraries that might be missing, but
there seems to be no consensus.
Any hint ?
Sincerely,
Filippo
--
⢀⣴⠾⠻⢶⣦⠀ Filippo Rusconi, PhD
⣾⠁⢠⠒⠀⣿⡁ Scientist at CNRS
⢿⡄⠘⠷⠚⠋⠀ Debian Developer
⠈⠳⣄⠀⠀⠀⠀ http://msxpertsuite.org
http://www.debian.org