Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - maximekahn

Pages: [1]
1
C / CSFML "Undefined Reference to sf::..."
« on: March 12, 2020, 01:32:11 pm »
Hi, I'm trying to use CSFML in c with Linux and gcc, the problem is that it sends me an error when i compile:
"Undefined Reference to sf :: RenderWindow :: ~ RenderWindow ()"
This means that it cannot find the SFML library in C++ (the binding library)

So, I added the SFML library in C++ in addition to the CSFML and I integrated it into my makefile

-----
main.o: main.c main.h
 gcc -c main.c -I ./Libraries/CSFML/CSFML/include/ -I ./Libraries/SFML/SFML/include/
class.o: class.c class.h
 gcc -c class.c -I ./Libraries/CSFML/CSFML/include/ -I ./Libraries/SFML/SFML/include/
build: main.o class.o
 gcc -ansi -Wall main.o class.o -o program -L ./Libraries/CSFML/CSFML/lib/ -L ./Libraries/SFML/SFML/lib/  -lsfml-graphics -lsfml-window -lsfml-system -lcsfml-graphics -lcsfml-window -lcsfml-system
-----

The problem is that it still can't find the reference, do you know how to fix it?
Is the Binding Library integration also done with the -L and -I command?

Pages: [1]
anything