msys64/ucrt64/include/vips/vips8:35:10: fatal error: glib-object.h: No such file or directory #include <glib-object.h>

354 Views Asked by At

I am trying to compile with mingw32-make but the following error is displayed:

g++ fitscli.cpp vipsoperations.cpp fits.cpp ConsoleTable.cpp `pkg-config vips-cpp `  -lcfitsio -ltiff -o fitscli
In file included from fitscli.cpp:7:
C:/msys64/ucrt64/include/vips/vips8:35:10: fatal error: glib-object.h: No such file or directory
   35 | #include <glib-object.h>

the makefile is:

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

And the file is too large so I will show where the error is (line 7 include <vips/vips8>:

#include <iostream>
#include <fstream>
#include <filesystem>
#include <stdint.h>
#include <math.h>
#include "include/cxxopts.hpp"
#include <vips/vips8>
#include "fitsio.h"
#include "include/vipsoperations.h"
#include "include/fits.h"
#include "include/ConsoleTable.h"
#define MAXPIXELS 1e8
using namespace std;
using namespace vips;
void saveheader(string header,string filename);
string histogram(VImage img,int bins);
void report_progress(int showprogress,string message)

I appreciate your Help. Now I am working on windows 11, with Msys UCRT64 and the last I tryed was to reinstall glib2 with pacman -S mingw-w64-ucrt-x86_64-glib2 but it does not work. and the Library is being installed successfully (/ucrt64/include/glib-2.0/glib-object.h)

I tried too many times to fix the glib_object.h path expecting that the command mingw32-make compile and produce a .exe file

1

There are 1 best solutions below

1
Marco Moreno On

Thank you @HolyBlackCat, your help was accurated.

the makefile must be completed with the flags:

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

(note --cflags --libs)

And "mingw32-make" must be executed from Bash