msys2/msys2.github.io

Can't compile gtk+3.0 program (warning: cannot find entry symbol xport-all-symbols; defaulting to 0000000140001000)

arturfabriciohahaedgy opened this issue · 2 comments

The program
I have made a simple application which at the moment only recieves a path input and prints it's path on the terminal. I started making it on Linux and considering that GTK is cross-platform I thought I could just clone the repo and use the Makefile that I wrote.

The error
When I type make I get the following error:
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: warning: --export-dynamic is not supported for PE+ targets, did you mean --export-all-symbols?

If I try to put --export-all-symbols in the Makefile I get the following error:
cc.exe: error: unrecognized command-line option '--export-all-symbols' make: *** [Makefile:6: FPS] Error 1

If I try to put with only one hifen: -export-all-symbols I get the following:
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: warning: cannot find entry symbol xport-all-symbols; defaulting to 0000000140001000

If I do what I just described (export-all-symbols with only one hifen) the program compiles, it generates an .exe, but if I run it, it doesn't do anything.

The code
If you want to look at the code to see if I'm doing something wrong:
Makefile
Entire repo

Ok, I was using the wrong syntax for the linker, solved by inserting:
-Wl,-export-all-symbols
And making an option at the Makefile:

CC = cc
PKG-CONFIG= `pkg-config --cflags --libs gtk+-3.0`
WINDOWSFLAGS = -Wall -Wextra -pipe -O2 -Wl,-export-all-symbols
CFLAGS = -Wall -Wextra -pipe -O2 -export-dynamic

FPS: src/window.c src/files.c
	${CC} src/window.c src/files.c -o FPS ${PKG-CONFIG} ${CFLAGS}

windows: src/window.c src/files.c
	${CC} src/window.c src/files.c -o FPS ${PKG-CONFIG} ${WINDOWSFLAGS}

This repository is for documentation and main website. Next time please open any mingw package related issues here https://github.com/msys2/MINGW-packages/issues. Thank you.