#g++: error: unrecognized command-line option ‘–cflags’g++: error: unrecognized command-line option

1 messages · Page 1 of 1 (latest)

rigid pelican
#

I did the steps in the link bellow and it didn’t work
https://wiki.gnome.org/Projects/gtkmm/MSWindows

I get the message error:

g++ -std=c++11 main.cpp $(pkg-config --cflags --libs gtkmm-3.0 | sed ‘s/ -I/ -isystem /g’)
g++: error: unrecognized command-line option ‘–cflags’
g++: error: unrecognized command-line option ‘–libs’
sed: -e expression #1, char 19: unknown option to `s’

g++ -std=c++11 main.cpp $(pkg-config --cflags gtkmm-3.0) $(pkg-config --libs gtkmm-3.0)
g++: error: unrecognized command-line option ‘–cflags’
g++: error: unrecognized command-line option ‘–libs’

old parcel
#

what did you try running it in?

#

sounds you might have tried running it in a shell that doesn't understand $() command substitution

slow pond
#

We already talked about that in another post!

rigid pelican
#

I tried with $() and without it , same results. I'm almost giving up on it. Interesting I can compile using codeblocks, Codeblocks compile it but I'am unable to run. Thats another problem. I would like to compile it using the command line.

sweet cloud
#

Those command lines are for POSIX shells like Bash. The MSYS and MINGW64 shells are such shells. Cmd doesn't understand that syntax.

old parcel
# sweet cloud Those command lines are for POSIX shells like Bash. The _MSYS_ and _MINGW64_ she...

(akchually, powershell sorta understands it,

PS C:\Users\cddeg> echo $(echo 123)
123

but that's besides the point and you almost never want to use powershell due to issues with piping and native tools with powershell always converting \n to \r\n between |)
You will always want to be using either MINGW64 or UCRT64 shells for anything related to mingw-w64 gcc compiling unless you know what you are doing and have it setup to access the tools from powershell

sweet cloud
#

I didn't know. Thanks.

old parcel
#

yw