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

Author Topic: CSFML & Code::Blocks - cannot find -lcsmfl-graphics  (Read 6320 times)

0 Members and 1 Guest are viewing this topic.

SirPL

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
CSFML & Code::Blocks - cannot find -lcsmfl-graphics
« on: December 20, 2013, 03:07:29 pm »
Hello everyone.
I just tried to use CSFML for making a project. I've never used any 3rd-part library (except GTK+) in my programs. I need help with running example code under Code::Blocks.
I followed tutorial at http://www.sfml-dev.org/tutorials/2.1/start-cb.php, but when I try to compile, I have errors like cannot find -lcsmfl-graphics. I know I did something wrong. But what?

I'm programming in C99
Sorry for dummy question.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10936
    • View Profile
    • development blog
    • Email
Re: CSFML & Code::Blocks - cannot find -lcsmfl-graphics
« Reply #1 on: December 20, 2013, 03:30:14 pm »
Quote
cannot find -lcsmfl-graphics
Maybe it's just a typo when posting, but it should obviously be "sfml". ;)

If that is not the problem, you need to provide more information, at best the full build command.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

SirPL

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Re: CSFML & Code::Blocks - cannot find -lcsmfl-graphics
« Reply #2 on: December 20, 2013, 11:21:15 pm »
The Build Messages:
ld.exe||cannot find -lsfml-graphics|
ld.exe||cannot find -lsfml-window|
ld.exe||cannot find -lsfml-system|
||=== Build finished: 3 errors, 0 warnings (0 minutes, 0 seconds) ===|
 

I'm compiling code from CSFML documentation.

I have CSFML library in C:\CSFML-2.1\

In project Build Options I set everything as it is in tutorial (of course I used my path instead of D:\SFML-2.1).


EDIT:

I managed to compile this code. Now I have another errors:

obj\Debug\main.o||In function `main':|
C:\Users\Mateusz\Desktop\gtk\SFML\SFMLtest\main.c|32|undefined reference to `_imp__sfMusic_createFromFile'|
C:\Users\Mateusz\Desktop\gtk\SFML\SFMLtest\main.c|36|undefined reference to `_imp__sfMusic_play'|
C:\Users\Mateusz\Desktop\gtk\SFML\SFMLtest\main.c|57|undefined reference to `_imp__sfMusic_destroy'|
||=== Build finished: 3 errors, 0 warnings (0 minutes, 3 seconds) ===|


EDIT 2:
I had do include csfml-audio to compile. Now everything is working.

You were wrong. I had to set csfml-window instead of sfml-window to run the code.

Everything is working right. Thank you for your help.
« Last Edit: December 20, 2013, 11:34:42 pm by SirPL »