g++: error: unrecognized command-line option '--cflags' g++: error: unrecognized command-line option '--libs`'

2.2k views Asked by At

I got these errors trying to execute mingw32-make:

g++: error: unrecognized command-line option '--cflags' g++: error: unrecognized command-line option '--libs'`

The makefile is the following:

all:
    g++ fitscli.cpp vipsoperations.cpp fits.cpp ConsoleTable.cpp `pkg-config vips-cpp --cflags --libs`  -lcfitsio -ltiff -o fitscli

After some research there was a suggestion to delete '--cflags' and '--libs` from the code, and I did it.

I know is that maybe the compiler g++ is not having able the options '--cflags' and '--libs` I also tried to change to gcc compiler, but doesn´t work.

I am working on windows 11, with Msys URCT64

When I deleted the lines suggested, is causing another compilation error, so I want to know how to fix the flags issue without deleted them from the code.

Thanks.

1

There are 1 answers

2
HolyBlackCat On

The backticks ` ` don't seem to work properly in mingw32-make (because it uses CMD as the shell, which doesn't support them).

Use make instead (install with pacman -S make), which uses Bash.