Currently I just created a small software in C and GTK + -3, everything is working perfectly on my machine but when I test the software on another laptop has several errors that refer to DLL libraries. On a first try the libglib-2.0-0.dll library was missing, then libwinpthread-1.dll, libintl-8.dll, libiconv-2.dll, library and whenever I add to the missing library a new missing library appears.
I'm wondering if there is any way to include the libraries in the executable at compile time?
I am using mingw64.exe for the build and this is my current makefile:
# Tools
CC=x86_64-w64-mingw32-gcc
LD=x86_64-w64-mingw32-gcc
CFLAGS=--std=c99 --pedantic -Wall -W -Wmissing-prototypes -g
LDFLAGS=
SGTKFLAGS=`pkg-config --cflags gtk+-3.0`
EGTKFLAGS=`pkg-config --libs gtk+-3.0`
# Files
EXEC=text_decoration
HEADERS=model.h view.h controller.h
MODULES=model.c view.c controller.c text_decoration.c
OBJECTS=model.o view.o controller.o text_decoration.o
# Commands
RM=rm
RMFLAGS=-f
# Start point
all:$(EXEC)
# Règle pour la génération de l'exécutable
text_decoration: $(MODULES) $(HEADERS)
$(CC) $(SGTKFLAGS) -g -o $(EXEC) $(MODULES) $(HEADERS) $(EGTKFLAGS)
clean:
$(RM) $(RMFLAGS) $(EXEC).exe
For a moment I thought it was due to compiling with the make command, when I try to use command nmake, I had the following error:
C:\msys64\home\Mooo\a>nmake
Microsoft (R) Program Maintenance Utility Version 14.00.24210.0
Copyright (C) Microsoft Corporation. All rights reserved.
x86_64-w64-mingw32-gcc `pkg-config --cflags gtk+-3.0` -g -o text_decoration model.c view.c controller.c text_decoration.c model.h view.h controller.h `pkg-config --libs gtk+-3.0`
x86_64-w64-mingw32-gcc.EXE: error: `pkg-config: No such file or directory
x86_64-w64-mingw32-gcc.EXE: error: gtk+-3.0`: No such file or directory
x86_64-w64-mingw32-gcc.EXE: error: `pkg-config: No such file or directory
x86_64-w64-mingw32-gcc.EXE: error: gtk+-3.0`: No such file or directory
x86_64-w64-mingw32-gcc.EXE: error: unrecognized command line option '--cflags'
x86_64-w64-mingw32-gcc.EXE: error: unrecognized command line option '--libs'
NMAKE : fatal error U1077: 'C:\msys64\mingw64\bin\x86_64-w64-mingw32-gcc.EXE' : return code '0x1'
Stop.