alandefreitas/matplotplusplus

MinGW Compiler Error using CMake.

Areshkew opened this issue · 2 comments

Bug category

  • bug - compilation error
  • bug - compilation warning
  • bug - runtime error
  • bug - runtime warning
  • bug - logic error

Describe the bug
Can't build the project.

Steps to Reproduce

cmake -B

Output

[1/2] Building CXX object CMakeFiles/VND_VRP.dir/main.cpp.obj
[2/2] Linking CXX executable VND_VRP.exe
FAILED: VND_VRP.exe

cmd.exe /C "cd . && C:\PROGRA~1\JETBRA~1\CLION2~1.2\bin\mingw\bin\G__~1.EXE -g  CMakeFiles/VND_VRP.dir/main.cpp.obj -o VND_VRP.exe -Wl,--out-implib,libVND_VRP.dll.a -Wl,--major-image-version,0,--minor-image-version,0  src/libNode.a  src/libVRP.a  src/libVehicle.a  src/libRoute.a  "C:/Program Files (x86)/Matplot++/lib/libmatplot.lib"  -lgdi32  "C:/Program Files (x86)/Matplot++/lib/Matplot++/libnodesoup.a"  -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ."

undefined reference to `matplot::network::marker_size(float)'
 undefined reference to `matplot::network::x_data
undefined reference to `matplot::network::y_data
...

Platform

  • cross-platform issue - linux
  • [x ] cross-platform issue - windows
  • cross-platform issue - macos

Environment Details:

  • OS: Windows 11
  • OS Version:
  • Compiler: MinGW
  • Compiler version: w64 9.0

Additional context

cmake_minimum_required(VERSION 3.20)

project( VND_VRP )

add_subdirectory(src)

add_executable(VND_VRP main.cpp)

find_package(Matplot++ REQUIRED)

target_link_libraries(VND_VRP Node VRP Vehicle Route Matplot++::matplot)

__cplusplus = 201703 (c++ 17)

I'm having the same issue

vs2022 can be compiled successfully, but MinGW unsuccessfully