Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22072

Unable to compile a C GTK app using GCC on Windows

$
0
0

I have installed GTK on my Windows machine an am attempting to compile a C program with GTK using GCC. I am using MSYS.

I have used pkg-config to get all of the relevant flags and dependencies text for the gcc command. Running the resulting command gives an error:

C:\Users\owner\programming\learngtk>gcc hello_world_gtk.c \
    -o hello_world_gtk.exe \
    -mms-bitfields \
    -pthread \
    -mms-bitfields \
    -IC:/msys64/mingw64/include/gtk-3.0 \
    -IC:/msys64/mingw64/include/cairo \
    -IC:/msys64/mingw64/include \
    -IC:/msys64/mingw64/include/pango-1.0 \ 
    -IC:/msys64/mingw64/include/fribidi \
    -IC:/msys64/mingw64/include \
    -IC:/msys64/mingw64/include/atk-1.0 \
    -IC:/msys64/mingw64/include/cairo \
    -IC:/msys64/mingw64/include/pixman-1 \
    -IC:/msys64/mingw64/include \
    -IC:/msys64/mingw64/include/freetype2 \
    -IC:/msys64/mingw64/include \
    -IC:/msys64/mingw64/include/harfbuzz \
    -IC:/msys64/mingw64/include/libpng16 \
    -IC:/msys64/mingw64/include/gdk-pixbuf-2.0 \
    -IC:/msys64/mingw64/include/libpng16 \
    -IC:/msys64/mingw64/include \
    -IC:/msys64/mingw64/lib/libffi-3.2.1/include \
    -IC:/msys64/mingw64/include/glib-2.0 \
    -IC:/msys64/mingw64/lib/glib-2.0/include \
    -IC:/msys64/mingw64/include \
    -LC:/msys64/mingw64/lib \
    -lgtk-3 -lgdk-3 -lgdi32 -limm32 -lshell32 \
    -lole32 -Wl,-luuid -lwinmm -ldwmapi -lsetupapi \
    -lcfgmgr32 -lz -lpangowin32-1.0 -lpangocairo-1.0 \
    -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo \
    -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lintl -lglib-2.0 

c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: cannot find -ldwmapi
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: cannot find -lpthread
collect2.exe: error: ld returned 1 exit status

Specifically this is the error:

c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: cannot find -ldwmapi
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: cannot find -lpthread

Any idea what the problem might be? Please note GCC was installed in a different Mingw installation than the one used to install GTK and pkg-config. Not sure if that should be the problem.


Viewing all articles
Browse latest Browse all 22072

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>