How Can I Build wxWidgets With Eclipse On Windows

2020-08-06 03:52发布

问题:

I installed wxWidgets 2.8.9 on a Windows XP SP2 box and built the library according to the directions and now I'm trying to get the Hello World! tutorial app to build from within Eclipse and I'm just missing something apparently. Any idea how to get Cygwin, Eclipse and wxWidgets to play nice together?

回答1:

This answer was posted by Lars Uffmann to the comp.soft-sys.wxwindows newsgroup. In a nutshell:

  1. Add c:/cygwin/usr/local/bin to the path in the Eclipse project configuration

  2. Add ``wx-config --cxxflags`‘ to the GCC C++ Compiler command

  3. Move the ${FLAGS} variable to the end of the GCC C++ Linker Command Line Pattern

  4. Add ``wx-config --libs`‘ to the GCC C++ Linker flags.

Thank goodness for Mr. Uffmann sharing this information; this problem has been giving me headaches for days.


EDIT: Note that there is a literal backtick at each end of the wx-config strings. The method of escaping the backtick doesn't seem to work correctly. Refer to the linked answer for more details on exact syntax.



回答2:

I built wxWidgets with MinGW on Windows myself and let CMake 2.6 create the Makefiles and project files for Eclipse on Windows. This works pretty well for me.