Difference between revisions of "Compiling wxWidgets with MinGW"

From WxWiki
Jump to navigation Jump to search
Line 75: Line 75:
 
it's probably because you have MSYS installed and the MSYS\bin folder in your PATH, and this confuses mingw32-make. Remove the MSYS\bin folder from your PATH and try again, it should work. (Alternatively, use MSYS to build wxWidgets, as described in build\msw\install.txt in the wxWidgets source tree).
 
it's probably because you have MSYS installed and the MSYS\bin folder in your PATH, and this confuses mingw32-make. Remove the MSYS\bin folder from your PATH and try again, it should work. (Alternatively, use MSYS to build wxWidgets, as described in build\msw\install.txt in the wxWidgets source tree).
  
[[
+
'''Winavr interference'''
'''Winavr interference''']]
 
 
In some cases, actually everything is fine, but you might have more than one similar complier installed on your machine.
 
In some cases, actually everything is fine, but you might have more than one similar complier installed on your machine.
  

Revision as of 04:13, 22 March 2011

This article applies to the following versions
Platform wxWidgets MinGW
Windows XP 2.8.11 5.1.4
Windows 7 2.9.1 5.1.4
Status: Up to Date
Related Articles
Using Makefiles to compile wxWidgets

Install MinGW

Please follow the steps described in Installing MinGW under Windows.

Download and Install wxWidgets

See Downloading and installing wxWidgets.

Build the library

Open the command prompt (Start > Run... > cmd). Change the directory to the build\msw folder. For example:

CD wx\\wx288\\build\\msw

Clean up the source:

mingw32-make -f makefile.gcc MONOLITHIC=1 SHARED=1 UNICODE=1 BUILD=release clean

Then, compile the library:

mingw32-make -f makefile.gcc MONOLITHIC=1 SHARED=1 UNICODE=1 BUILD=release
Note: For more information on the UNICODE and BUILD options, see WxWidgets Build Configurations.


Build Output

In the example above a DLL was created under \lib\gcc_dll. The resultant setup.h file can be found under \lib\gcc_dll\mswu\wx

See Also

Understanding wxWidgets Build Scheme
Precompiled Headers in MinGW

Troubleshooting

Note: if you get errors like this:

if not exist gcc_mswu mkdir gcc_mswu
process_begin: CreateProcess(NULL, -c "if not exist gcc_mswu mkdir gcc_mswu", ...) failed.
make (e=2): The system cannot find the file specified.
mingw32-make: [gcc_mswu] Error 2 (ignored)
if not exist ..\..\lib\gcc_lib mkdir ..\..\lib\gcc_lib
process_begin: CreateProcess(NULL, -c "if not exist ..\..\lib\gcc_lib mkdir ..\..\lib\gcc_lib", ...) failed.
make (e=2): The system cannot find the file specified.
mingw32-make: *** [..\..\lib\gcc_lib] Error 2

it's probably because you have MSYS installed and the MSYS\bin folder in your PATH, and this confuses mingw32-make. Remove the MSYS\bin folder from your PATH and try again, it should work. (Alternatively, use MSYS to build wxWidgets, as described in build\msw\install.txt in the wxWidgets source tree).

Winavr interference In some cases, actually everything is fine, but you might have more than one similar complier installed on your machine.

For a real example, I have C:\WinAVR-20100110\bin;C:\WinAVR-20100110\utils\bin; installed on my machine for some microcontroller firmware development.

The installed WinAVR containing a series GNU compiler like gcc, g++ , etc.

As the WinAVR tool chain is also registered to the window via PATH environment variable.So same kind of error as aboved occurs when I tried to compile wxWidgets-2.8.11.

This could be solved by temporary remove the related Winavr directory locaiton from PATH environment variable.(Not only your current user environment variable also the Global environment variable set by administrator)

External Links

Code::Block's WxWindowsQuickRef
Compiling wxWidgets 2.8.6 to develop Code::Blocks (MSW)