Contents |
#include "wx/wx.h"
class MyApp: public wxApp {
public:
int OnRun(void);
};
IMPLEMENT_APP(MyApp)
int MyApp::OnRun(void) {
wxMessageBox(wxT("Hello World!"), wxT("Hello World"));
return 0;
}
g++ -c `wx-config --cxxflags` minimal.cpp g++ minimal.o `wx-config --libs` -o minimal.exe
I couldn't get it to work without MSYS.
Prerequisites: MinGW and MSYS (I couldn't get it to work without msys, and you may have to update your MinGW/MSYS installation)
./configure, make, and make install.
require 'rake/clean'
# OPTIONS --------------------------------------------------------------------
EXES = FileList['minimal.exe']
COMPILE_OPTIONS = "`wx-config --cxxflags`"
LIBRARY_OPTIONS = "`wx-config --libs`"
# FILE LISTS -----------------------------------------------------------------
SRC = FileList['*.cpp', '*.h']
OBJ = SRC.ext('o')
CLEAN.include OBJ
CLOBBER.include EXES
# TASKS ----------------------------------------------------------------------
desc 'Build application.'
task :default => ['tags'] + EXES
# DEPENDENCIES ---------------------------------------------------------------
file 'minimal.o' => ['minimal.cpp']
file 'minimal.exe' => ['minimal.o']
# COMPILING ------------------------------------------------------------------
rule '.o' => '.cpp' do |t|
sh "sh -c \"g++ -c #{COMPILE_OPTIONS} -o #{t.name} #{t.source}\""
end
# LINKING --------------------------------------------------------------------
rule '.exe' => '.o' do |t|
sh "sh -c \"g++ #{t.source} #{LIBRARY_OPTIONS} -o #{t.name}\""
end