Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SUMO doesn't compile using Mingw32 #4355

Open
5 of 6 tasks
palvarezlopez opened this issue Jul 25, 2018 · 5 comments
Open
5 of 6 tasks

SUMO doesn't compile using Mingw32 #4355

palvarezlopez opened this issue Jul 25, 2018 · 5 comments
Assignees
Labels
Milestone

Comments

@palvarezlopez
Copy link
Member

palvarezlopez commented Jul 25, 2018

  • Problem with foreign library "socket" and Windows version (WIN32 seems to be undefined)
  • References in Microsim and "Devices" to Fox Functions
  • Segmentation Fault compiling Function GUIDanielPerspectiveChanger::onMouseMove(void*). It causes by O2/O3 option
  • Google Test cannot be compiled with Mingw32 (Ticket)
  • problem with system includes see gcc seems broken msys2/MINGW-packages#10761 (workaround: remove SYSTEM whenever you add include_dirs in the root CMakeLists.txt)
  • proj and Fox do not get picked up although they are installed
@palvarezlopez palvarezlopez added this to the 1.0.0 milestone Jul 25, 2018
@palvarezlopez palvarezlopez self-assigned this Jul 25, 2018
@palvarezlopez
Copy link
Member Author

palvarezlopez commented Jul 25, 2018

[ 36%] Linking CXX executable ..\..\..\bin\sumo.exe
microsim/libmicrosim.a(MSEdge.cpp.obj):MSEdge.cpp:(.text+0x350a): undefined reference to FX::FXMutex::unlock()
microsim/libmicrosim.a(MSEdge.cpp.obj):MSEdge.cpp:(.text+0x3bb2): undefined reference to FX::FXMutex::lock()
microsim/libmicrosim.a(MSEdge.cpp.obj):MSEdge.cpp:(.text+0x5f78): undefined reference to FX::FXMutex::lock()
microsim/libmicrosim.a(MSEdge.cpp.obj):MSEdge.cpp:(.text+0x5fa0): undefined reference to FX::FXMutex::unlock()
microsim/libmicrosim.a(MSNet.cpp.obj):MSNet.cpp:(.text$_ZN7CarEdgeI6MSEdge6MSLane10MSJunction11SUMOVehicleEC1EiPKS0_d[_ZN7CarEdgeI6MSEdge6MSLane10MSJunction11SUMOVehicleEC1EiPKS0_d]+0x1e0): undefined reference to FX::FXMutex::FXMutex(unsigned char)
microsim/libmicrosim.a(MSNet.cpp.obj):MSNet.cpp:(.text$_ZN7CarEdgeI6MSEdge6MSLane10MSJunction11SUMOVehicleED1Ev[_ZN7CarEdgeI6MSEdge6MSLane10MSJunction11SUMOVehicleED1Ev]+0x1d): undefined reference to FX::FXMutex::~FXMutex()
microsim/libmicrosim.a(MSNet.cpp.obj):MSNet.cpp:(.text$_ZN7CarEdgeI6MSEdge6MSLane10MSJunction11SUMOVehicleED0Ev[_ZN7CarEdgeI6MSEdge6MSLane10MSJunction11SUMOVehicleED0Ev]+0x1d): undefined reference to FX::FXMutex::~FXMutex()
microsim/libmicrosim.a(MSNet.cpp.obj):MSNet.cpp:(.text$_ZNK7CarEdgeI6MSEdge6MSLane10MSJunction11SUMOVehicleE13getSuccessorsE16SUMOVehicleClass[_ZNK7CarEdgeI6MSEdge6MSLane10MSJunction11SUMOVehicleE13getSuccessorsE16SUMOVehicleClass]+0x52): undefined reference to FX::FXMutex::lock()
microsim/libmicrosim.a(MSNet.cpp.obj):MSNet.cpp:(.text$_ZNK7CarEdgeI6MSEdge6MSLane10MSJunction11SUMOVehicleE13getSuccessorsE16SUMOVehicleClass[_ZNK7CarEdgeI6MSEdge6MSLane10MSJunction11SUMOVehicleE13getSuccessorsE16SUMOVehicleClass]+0x1b8): undefined reference to FX::FXMutex::unlock()
microsim/libmicrosim.a(MSNet.cpp.obj):MSNet.cpp:(.text$_ZNK7CarEdgeI6MSEdge6MSLane10MSJunction11SUMOVehicleE13getSuccessorsE16SUMOVehicleClass[_ZNK7CarEdgeI6MSEdge6MSLane10MSJunction11SUMOVehicleE13getSuccessorsE16SUMOVehicleClass]+0x3c2): undefined reference to FX::FXMutex::unlock()
microsim/libmicrosim.a(MSRoute.cpp.obj):MSRoute.cpp:(.text+0xaee): undefined reference to FX::FXMutex::lock()
microsim/libmicrosim.a(MSRoute.cpp.obj):MSRoute.cpp:(.text+0xbc1): undefined reference to FX::FXMutex::unlock()
microsim/libmicrosim.a(MSRoute.cpp.obj):MSRoute.cpp:(.text+0xf30): undefined reference to FX::FXMutex::lock()
.....

@palvarezlopez
Copy link
Member Author

Segmentation Fault:

C:\Projects\sumo\src\utils\gui\windows\GUIDanielPerspectiveChanger.cpp: In member function 'virtual void GUIDanielPerspectiveChanger::onMouseMove(void*)':
C:\Projects\sumo\src\utils\gui\windows\GUIDanielPerspectiveChanger.cpp:216:1: internal compiler error: Segmentation fault
 GUIDanielPerspectiveChanger::onMouseMove(void* data) {
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~
libbacktrace could not find executable to open
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://sourceforge.net/projects/mingw-w64> for instructions.
mingw32-make[3]: *** [src\utils\gui\windows\CMakeFiles\utils_gui_windows.dir\build.make:63: src/utils/gui/windows/CMakeFiles/utils_gui_windows.dir/GUIDanielPerspectiveChanger.cpp.obj] Error 1
mingw32-make[2]: *** [CMakeFiles\Makefile2:4843: src/utils/gui/windows/CMakeFiles/utils_gui_windows.dir/all] Error 2
mingw32-make[1]: *** [CMakeFiles\Makefile2:2556: src/netedit/CMakeFiles/netedit.dir/rule] Error 2
mingw32-make: *** [Makefile:707: netedit] Error 2

C:\Projects\sumo\build\cmake-codeblocks>

@behrisch
Copy link
Contributor

behrisch commented Jul 1, 2022

I just retried this with the most recent msys including gcc 12 and cmake 3.22.1 and updated the ToDos above. The include in problem in socket.cpp did re-appear.

@behrisch
Copy link
Contributor

behrisch commented Jul 1, 2022

I could resolve many of the problems above by using the correct cmake. So be sure not to install msys/cmake but mingw64/mingw-w64-x86_64-cmake

@behrisch
Copy link
Contributor

behrisch commented Jul 1, 2022

The major point we need to decide / discuss is whether the mingw build should be done with the SUMOLibraries or with the MinGW libraries (it seems to provide everything we need) or maybe even both. If I replace the SUMOLibraries with the mingw ones at least some of the linker errors currently disappear but you can run the resulting binary only in the mingw shell (or you need to adapt the PATH).

behrisch added a commit that referenced this issue Jul 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants