0

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.

  • What is your `make`'s version as well? You may be accidentally using some DOS/Windows-specific `make` instead of the one from Msys, which does not support backticks around `pkg-config`. – yeputons Dec 28 '22 at 14:14
  • I installed with this command= "pacman -S mingw-w64-ucrt-x86_64-make" and the outcome is mingw32-make.exe, that is in this folder: C:\msys64\ucrt64\bin – Marco Moreno Dec 28 '22 at 15:27

1 Answers1

2

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.

HolyBlackCat
  • 78,603
  • 9
  • 131
  • 207