add libgpio to project


beginner question: I followed this tutorial C/C++ Development and Debugging on TorizonCore Using Visual Studio Code | Toradex Developer Center but I can’t get my simple application to link. This is the output I’m getting:

> Executing task: arm-linux-gnueabihf-g++ -g TestGPIO.cpp -o TestGPIO <

/usr/lib/gcc-cross/arm-linux-gnueabihf/10/../../../../arm-linux-gnueabihf/bin/ld: /tmp/cccCNdZL.o: in function `main':
/workspaces/TestGPIO/TestGPIO.cpp:15: undefined reference to `gpiod_ctxless_set_value'
collect2: error: ld returned 1 exit status
The terminal process "bash '-c', 'arm-linux-gnueabihf-g++ -g TestGPIO.cpp -o TestGPIO'" terminated with exit code: 1.

It must be something small, but as a beginner, I have no clue where to start. Any help is much appreciated!

Managed to get it running by adding “-l” and “gpiod” to “args” in tasks.json. I guess using a makefile would have been easier.

Glad you were able to get it going.

But yes if you’re not using a makefile based project then the compile/gcc commands are defined in tasks.json. Meaning that’s where you would have to add the link to any libraries.

Best Regards,