Search code examples
c++visual-studio-codearmcross-platformgtkmm

How to link to libraries downloaded with Homebrew in Visual Studio Code?


I just downloaded GTKMM using Homebrew but I don't know how to link to it with Visual Studio Code. I have a c_cpp_properties file as well as a tasks.json (Both C/C++ settings files) that I can use to link to files with.

Do I link to the downloaded package directly (opt/Homebrew/Cellar/gtkmm) or do I need to link it to somewhere else, like /Library/Frameworks/?

I am on an ARM Mac, using C++ and Visual Studio Code. I also need to make sure my project is cross-platform.


Solution

  • You may install pkg-config and it will make the life of a developer sweeter:

    brew install pkg-config
    pkg-config --cflags --libs gtkmm
    

    The last command shows the required compiler and linker flags for using gtkmm.