0

When i run build task from the terminal in vs code i get this error:

c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe: cannot find -lpangowin64-1.0
C:/msys64/mingw64/bin/../lib/libmingw32.a: error adding symbols: File format not recognized
collect2.exe: error: ld returned 1 exit status

Build finished with error(s).

Here's my c_cpp_properies.json (only includePaths):
(All the include paths are taken from pkgconf --cflags)

"includePath": [
                "${workspaceFolder}/**",
                "C:\\msys64\\mingw64\\include\\gtk-4.0\\gtk",
                "C:\\msys64\\mingw64\\include\\gtk-3.0\\gtk",
                "C:\\msys64\\mingw64\\include\\pango-1.0",
                "C:\\msys64\\mingw64\\include\\**",
                "C:\\msys64\\mingw64\\include\\glib-2.0",
                "C:\\msys64\\mingw64\\include\\harfbuzz",
                "C:\\msys64\\mingw64\\include\\freetype2",
                "C:\\msys64\\mingw64\\include\\libpng16",
                "C:\\msys64\\mingw64\\include\\fribidi",
                "C:\\msys64\\mingw64\\include\\cairo",
                "C:\\msys64\\mingw64\\include\\lzo",
                "C:\\msys64\\mingw64\\include\\pixman-1",
                "C:\\msys64\\mingw64\\include\\gdk-pixbuf-2.0",
                "C:\\msys64\\mingw64\\include\\webp",
                "C:\\msys64\\mingw64\\include\\graphene-1.0",
                "C:\\msys64\\mingw64\\lib\\gtk-4.0",
                "C:\\msys64\\mingw64\\lib\\glib-2.0",
                "C:\\msys64\\mingw64\\lib\\**"
            ],

And here's tasks.json(only args (from pkgconf --libs)):

"args": [
                "-fdiagnostics-color=always",
                "-g",
                    "-I${includePath <all elements>}",
                "${file}",
                    "-lgtk-4",
                    "-lpangowin64-1.0", 
                    "-lpangocairo-1.0", 
                    "-lpango-1.0", 
                    "-lharfbuzz", 
                    "-lgdk_pixbuf-2.0", 
                    "-lcairo-gobject", 
                    "-lcairo",
                    "-lgraphene-1.0", 
                    "-lgio-2.0",
                    "-lgobject-2.0", 
                    "-lglib-2.0",
                    "-lintl", 
                "-o",
                "${fileDirname}\\${fileBasenameNoExtension}.exe",
            ],

I have installed all the necessary libraries such as gtk4, toolchain base_devel, glib all from msys64 console

How do i solve this error ?

PS: Aim is to build a GUI based program using C, i have now selected GTK, any alternatives are appreciated too. Also should i switch from VS Code for a better environment ?

5
  • yes vs code has better environment than any other alternative Commented Mar 5, 2023 at 11:44
  • @nischalsharma thank you for the input, do you have any insight on the error I am facing ? Commented Mar 5, 2023 at 11:56
  • Does your file actually say "-I${includePath <all elements>}"? Or did you just type it that way in your question to save space? I have never seen such syntax before. Should it not be one -I <path> for each include directory? Commented Mar 5, 2023 at 20:08
  • @user no it was written to save space Sorry for being so vague Commented Mar 6, 2023 at 4:05
  • please use actual synax to avoid confusion. see also the instructions on providing a minimal reproducible example Commented Mar 6, 2023 at 4:12

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.