Answer the question
In order to leave comments, you need to log in
How to connect this library to the project correctly?
I need to write a program in C ++, and since I really don't want to enter the paths by hand, I want to include this library here .
But since I'm new to C++, I don't quite understand how to do this. There is no command in its sources make install
and it cannot be installed via apt
.
I am also not very familiar with the structure of C ++ projects and I do not quite understand what is happening here.
I have such a project (the structure is generated by VSCode):
Since I have never installed libraries in this way and in general I have been on the pros for less than a week, it is not very clear to me what and where to put it in order to make it work.
What the developer says about building it: https://github.com/mlabbe/nativefiledialog#building
Answer the question
In order to leave comments, you need to log in
The nativefiledialog code has a Makefile for building with GNU Make. Since you also use make, the process is something like this:
1. Copy the library code to the lib/nativefiledialog folder
git clone https://github.com/mlabbe/nativefiledialog.git lib/nativefiledialog
all: my_program
my_program: nfd_lib
g++ -Llib/nativefiledialog/build/lib/Release/x64 -Ilib/nativefiledialog/src/include \
-lnfd src/main.cpp -o my_program
clean: nfd_clean
rm *.o my_program
nfd_lib:
make -C lib/nativefiledialog/build/gmake_linux
nfd_clean:
make -C lib/nativefiledialog/build/gmake_linux clean
#include <nfd.h>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question