Well, that's it. I'm sure the title is descriptive enough. I'm trying to compile a hello world sort of application I wrote in C++ with wxWidgets. I have four files, let's call them frame1.h, frame1.cpp, main.h and main.cpp.
I just need a simple (if possible) method to compile the application from the cmd prompt, preferably from a .bat script file.
I googled it, but everything I found was about compiling the wxWidgets library, which I already did, or compiling applications with Visual Studio or other IDEs like Code::Blocks. I just want to do it from the command prompt with MinGW. I found a method that used back ticks but those aren't supported in Windows and I don't even know if it would work even if there was a workaround of some sort.
I know asking for a step by step method would be too pretentious but it would be very appreciated. Of course, I know that might not be possible, but I doubt compiling an application can be rocket science and probably I'm just missing something very obvious cause I'm stupid.
EDIT: I compile my applications like this...
g++ -Wall -c -o ClassFile.o ClassFile.cpp
g++ -Wall -o Program.exe ClassFile.o main.cpp
...for example. I'm looking for a similar method to compile wxWidget apps.
Well, thank you. Good luck.
If you've already compiled wxWidgets successfully, go to the samples/minimal
subdirectory and type make -f makefile.gcc -n
. This will show you the commands used to build the minimal sample, including all wxWidgets-specific options you must use for both the compilation and link commands. Unfortunately, if you use cmd.exe your only solution is to manually copy-paste these options in another window (replacing "minimal" with your program name, of course) as, as you already know, it doesn't support the command substitution (backticks) mechanism.
As this gets tiresome pretty quickly, the usual thing to do is to write a makefile, even if it's just a very simple one, where these options are defined in variables that are then reused for all files.