I build wxWidgets-3.1.0 with MSYS with the following commands: ../configure --prefix=/mingw --enable-shared and make && make install. I can run samples such as minimal.cpp without problems. When trying to link wxWidgets in my cmake I get the following errors:
g++.exe: error: /C/wxWidgets-3.1.0/build-release/lib/libwx_baseu_net-3.1.a: No such file or directory
g++.exe: error: /C/wxWidgets-3.1.0/build-release/lib/libwx_mswu_core-3.1.a: No such file or directory
g++.exe: error: /C/wxWidgets-3.1.0/build-release/lib/libwx_baseu-3.1.a: No such file or directory
I checked the lib folder, and these files do exist as you can see at the end of the post.
When running wx-config --libs I get the following output:
-L/C/wxWidgets-3.1.0/build-release/lib -Wl,--subsystem,windows -mwindows /C/wxWidgets-3.1.0/build-release/lib/libwx_mswu_xrc-3.1.a /C/wxWidgets-3.1.0/build-release/lib/libwx_mswu_qa-3.1.a /C/wxWidgets-3.1.0/build-release/lib/libwx_baseu_net-3.1.a /C/wxWidgets-3.1.0/build-release/lib/libwx_mswu_html-3.1.a /C/wxWidgets-3.1.0/build-release/lib/libwx_mswu_adv-3.1.a /C/wxWidgets-3.1.0/build-release/lib/libwx_mswu_core-3.1.a /C/wxWidgets-3.1.0/build-release/lib/libwx_baseu_xml-3.1.a /C/wxWidgets-3.1.0/build-release/lib/libwx_baseu-3.1.a -lwxregexu-3.1 -lwxexpat-3.1 -lwxtiff-3.1 -lwxjpeg-3.1 -lwxpng-3.1 -lz -lrpcrt4 -loleaut32 -lole32 -luuid -lwinspool -lwinmm -lshell32 -lshlwapi -lcomctl32 -lcomdlg32 -ladvapi32 -lversion -lwsock32 -lgdi32
The cmake should be fine and the wxWidgets package is found. Below the linking of the wxWidgets library. The second line gives the errors.
Code: Select all
add_executable(GUI ${GUI_BUILD_SOURCES})
target_link_libraries(GUI ${LIBS} ${wxWidgets_LIBRARIES})
Thanks.