SFML community forums

Help => General => Topic started by: luckyluckluck on July 21, 2017, 02:07:53 am

Title: Compiling in terminal- Mac
Post by: luckyluckluck on July 21, 2017, 02:07:53 am
I have been trying to compile my code using g++ main.cpp -L <path to library folder> -l <libraryname>

I have downloaded the SFML package onto my Desktop with a file path of /Users/Erica/Desktop/SFML

The file I a trying to compile is also on the Desktop, "Graphics.cpp"

I have tried putting "Graphics.hpp" and "sgml-graphics" for the library name

No matter what I do I keep getting this message when I compile:

Graphics.cpp:3:10: fatal error: 'SFML/Graphics.hpp' file not found
#include <SFML/Graphics.hpp>

I am completely out of ideas for compiling, I have tried every solution on 4 pages of google for this issue and I am continuing to get this same error. I have attached a screen shot.

PLEASE HELP ME COMPILE IM GOING CRAZYYYY
Title: Re: Compiling in terminal- Mac
Post by: Hiura on July 21, 2017, 08:51:45 am
You should take a moment to read the manpage, you're completely mixing the meaning of your compiler options.
Title: Re: Compiling in terminal- Mac
Post by: jamesL on July 22, 2017, 12:03:25 am
try
-I instead of -L

-I /users/Erica/Desktop/SFML/include -lsfml-graphics -lsfml-window -lsfml-system

https://courses.cs.washington.edu/courses/cse373/99au/unix/g++.html

http://web.engr.oregonstate.edu/~rubinma/Mines_274/Content/Slides/05_compilation.pdf