I'm beginning to teach myself a bit of C++ these days off, and I decided to learn some GUI programming in the meantime. Thing is, it just won't compile, either using GTK (Windows bundle 3.6.4) or wxWidgets (3.0.0). The error I get is similar for both, so I'm sticking with GTK+ for this question.
After 5 days (7 recompiles of wx, many tutorials, SO questions and google), this is how I'm trying to compile the code (I'm under Windows 7, 64 bits, and it's not an option to switch to Linux right now):
@echo off
set cygpath=C:\Cygwin\bin
set filename=simple
%cygpath%\bash.exe -c "gcc $(pkg-config --cflags gtk+-3.0) -o %filename% %filename%.c $(pkg-config --libs gtk+-3.0)"
echo.
pause
But the only output I get is this (backtilts instead of $()
returns the same thing):
: Invalid argument
: Invalid argument
I tried the same without Cygwin at first, but the results were:
gcc: error: $(pkg-config: No such file or directory
gcc: error: gtk+-3.0): No such file or directory
gcc: error: $(pkg-config: No such file or directory
gcc: error: gtk+-3.0): No such file or directory
gcc: error: unrecognized command line option '--cflags'
gcc: error: unrecognized command line option '--libs'
Using quotes or double quotes didn't help at all. I tried all these in both cygwin-bash or Windwos prompt
I'm totally new to C++, wxWidgets and GTK+ and I already saw this, but since it didn't solve my problem and I can't comment because of reputation, I thought I had to open a new question.
Also, I changed the compiler to TDM-GCC because I couldn't compile wx with MinGW. Is this somewhat related? What am I missing here?
Thanks in advance for any help.
EDIT: Sorry, just realized that the sample was written in C, not C++. I'm adding the tag now. (However, the error is the same with the C++ code I'm using for wx, so I'm keeping the C++ tag.)