Hi
I'm trying to compile and link my _first_ wx program (the sample program in the wx docs) from the command line. Which command should be used from the command line for compiling and linking? I have tried finding this command on the wx site but am unable to do so; hence the query.
I have already compiled the wx source on my Windows PC and have successfully created a set of static libraries (*.a) in the lib\gcc_libs folder of the wx Installation folder.
The following Env vars on my system have been defined:
1) MINGW refers to the GCC compiler executable's folder.
2) WXWIN refers to the WX installation folder.
Thanks
Steven
Command-line command for compiling and linking a wx app
Re: Command-line command for compiling and linking a wx app
Hi
I used the following BAT file to compile and link the "Hello World" wx program:
F:
CD \Files\C\SW\Applications\Samples\C++Samples\wxwidgets\HelloWorld0
g++ -o HelloWorldwx.exe -ID:\Libs\wxWidgetsStaticLib\include HelloWorldwx.cpp -LD:Libs \wxWidgetsStaticLib\lib -llibwxbase30ud.a -LD:Libs\wxWidgetsStaticLib\lib -llibwxmsw30ud_core.a
PAUSE
HelloWorldwx
The compilation starts but the compiler issues an error saying file "setup.h" is missing.
I searched a bit and found one "setup.h" file in some sub-folder of wx and copied it to the right place. But then the compilation (proper) fails, giving several errors.
Can anyone help? Thanks
Steven
I used the following BAT file to compile and link the "Hello World" wx program:
F:
CD \Files\C\SW\Applications\Samples\C++Samples\wxwidgets\HelloWorld0
g++ -o HelloWorldwx.exe -ID:\Libs\wxWidgetsStaticLib\include HelloWorldwx.cpp -LD:Libs \wxWidgetsStaticLib\lib -llibwxbase30ud.a -LD:Libs\wxWidgetsStaticLib\lib -llibwxmsw30ud_core.a
PAUSE
HelloWorldwx
The compilation starts but the compiler issues an error saying file "setup.h" is missing.
I searched a bit and found one "setup.h" file in some sub-folder of wx and copied it to the right place. But then the compilation (proper) fails, giving several errors.
Can anyone help? Thanks
Steven
Re: Command-line command for compiling and linking a wx app
Building wxW libs is rather simple, by running the following command in %WXWIN%\build\msw :
When building your code you should keep the same options, same relevant paths etc. In order to do that the easiest way IMO is to go to samples/minimal, edit minimal.cpp to contain your code, and run the same command there (it will obviously pick up the makefile from the sample folder).
Good luck!
There are multiple options that can be changed from the default values, but for a first "hello world" I guess you don't need to.mingw32-make.exe -f makefile.gcc
When building your code you should keep the same options, same relevant paths etc. In order to do that the easiest way IMO is to go to samples/minimal, edit minimal.cpp to contain your code, and run the same command there (it will obviously pick up the makefile from the sample folder).
Good luck!
Re: Command-line command for compiling and linking a wx app
Hi
Thanks for the guidance. I have tried it and confirm it works!
Thanks
Steven
Thanks for the guidance. I have tried it and confirm it works!
Thanks
Steven