简体   繁体   中英

Problems to compile source code with wxWidgets (MinGW mode) on Windows 10

I am having serious problems to compile a code in Windows (regard3d at http://www.regard3d.org ). I have read so many post (two days blocked on this problem) here at stackoverflow and other sites, but without success.

The problem is that it needs wxWidgets. For that I am using MinGW. I have VS Community (the latest version). I run my CMakeLists.txt and everytime I get the message

Could NOT find wxWidgets (missing: wxwidgets_LIBRARIES wxwidgets_INCLUDE_DIRS)

I included the wxWidgets installation directory (which is C:\\wxWidgets-3.1.0 ) in PATH variable (I restarted to it takes effect) and created the variable WXWIN (that also contains the installation directory).

The question: What can I do to solve it?

I think the problem is not building the wxWidgets, but make it be found my cmake. As mentioned, I built it using MinGW, thus I have the folder C:\\wxWidgets-3.1.0\\lib\\gcc_dll and the folder C:\\wxWidgets-3.1.0\\include which contains two more folders named wx and msvc . I am using the following settings before call the cmake:

set wxWidgets_ROOT_DIR=C:\wxWidgets-3.1.0
set R3D_ALT_wxWidgets_INCLUDE_DIRS=include
set R3D_ALT_wxWidgets_LIBRARIES=lib\gcc_dll 
set wxWidgets_CONFIG_EXECUTABLE=build\msw 

I'm not very familiar with wxWidgets (so this should probably be a comment, but I can't comment because reasons......), but a quick hack that should work is just throwing the path to the library in LD_LIBRARY_PATH or including it by adding

CPPFLAGS += -L C:\wxWidgets-3.1.0\lib\gcc_dll -I C:\wxWidgets-3.1.0\include

to your makefile.

Failing that, you could explicitly set the environmental variables it's complaining about outside of the makefile.

Again, sorry, this should be a comment. It's not... If someone wants to copy it to a comment and delete this, that'd be grand.

Thank all of you. Solved! Yesterday I compiled both with MinGW and VS and settled the wxWidgets-3.1.0_INCLUDE_DIRS and it worked!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM