My question is, how do I link a third party library with my project using g++?
The specific library I'm trying to use is SFML.
I've seen countless of tutorials on how to do this using an IDE, but I'm solely using notepad++. I have the package containing SFML's object code, header files, etc. I've tried using -L and -I in compilation to direct the compiler to the object code and inclusions respectively, but no luck.
you can set up another env variable like your 'path' variable but with these folders, and the name of the variable is CPATH . g++ should see it.
or on the command line I think you want 'I' and path whihc looks like what you have tried already. Have you tried the 'I' with WINDOWS looking paths, like -IC:\foo\ ? the slash format... maybe I am confusing myself again.. is /folder only ok for a subfolder of current location?
Regardless .. I suspect fully qualified win paths will work, and I suspect you have a subtle error in your paths is the issue, so either fully qualify, use the env var, or try to fix the issue ( I just don't see it tonight) ... one of those should get you rolling
Is your main.cpp on the Desktop?
First, you have a typo: -LSMFL-2.5.1/lib
But that's the linker settings. The second problem is that it can't find the header folder.
Instead of #include "SFML/System.hpp"
do #include <SFML/System.hpp>
Third, since the "SFML" is part of your individual #include, don't put "SFML" in the compiler flag. Just make it be -ISFML-2.5.1/include
If those three things don't work, try using a global path instead. So instead of -ISFML-2.5.1/include/SFML try -IC:/Users/thmir/OneDrive/Desktop/SFML-2.5.1/include
For brevity, I usually have a folder like C:\libraries that I put all my third-party libraries in instead of cluttering the Desktop with it.