User forums > Help

Beginner - pb with my program - C langage

<< < (3/4) > >>

jpapot:
I've got a last problem and maybe you can help me ;

It seems that c::b does not recognize the SDL library.
Is it installed ? If not how to do this ?

Here is the result of my compilation :


--- Code: ---gcc   -c /home/jp/Documents/Mandelbrot.c -o /home/jp/Documents/Mandelbrot.o
/home/jp/Documents/Mandelbrot.c:4:21: fatal error: SDL/SDL.h: Aucun fichier ou dossier de ce type   <- no such file or directory (I translate)
                     ^
compilation terminated.
Process terminated with status 1 (0 minute(s), 0 second(s))
1 error(s), 0 warning(s) (0 minute(s), 0 second(s))
--- End code ---

So what should I do ?  :o

Thanks again for your help.

Have a nice day.  ;)
JP

BlueHazzard:
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_What_do_I_need_to_know_when_using_3rd_party_libs.3F

jpapot:
Thanks for the link, BlueHazzard.

I try but for the moment without success.
Here is what I did: (I am under linux)

1) I saw that "libsdl1.2debian" is the SDL lib package installed.
2) I searched where in the computer is the SDL library. I founded this : /usr/lib/i386-linux-gnu/libSDL-1.2.so.0.11.4   Is it the library I need ? It's not a .a or .so or .lib because of the 0.11.4 !
3) I created an SDL project with codeblocks and put it here : /home/jp/Documents/Mandelbrot linux/
4) then in Project->Build Options->Search directories->Compiler , I put this : /home/jp/Documents/Mandelbrot linux/   (correct ?)
5) then in Project->Build Options->Search directories->Linker, ...  I don't know where is my compiled library !!!

So I stopped here for the moment.
Maybe somebody can have an idea or tell me what's wrong  :)

Thanks again for your help. English is not my first language  ;)
JP

BlueHazzard:
https://www.youtube.com/watch?v=CiEwXjq4_yo

http://wiki.codeblocks.org/index.php?title=Using_SDL_with_Code::Blocks

http://ubuntuforums.org/showthread.php?t=453171

http://lazyfoo.net/tutorials/SDL/01_hello_SDL/windows/codeblocks/

http://www.codewithc.com/how-to-setup-sdl-in-codeblocks/

ecc. ecc. google is your friend...


--- Quote from: jpapot on July 07, 2015, 10:22:30 pm ---4) then in Project->Build Options->Search directories->Compiler , I put this : /home/jp/Documents/Mandelbrot linux/   (correct ?)

--- End quote ---
no, there should be the path to the sdl include directory
http://stackoverflow.com/questions/10488775/sdl-h-no-such-file-or-directory-found-when-compiling


--- Quote from: jpapot on July 07, 2015, 10:22:30 pm ---5) then in Project->Build Options->Search directories->Linker, ...  I don't know where is my compiled library !!!

--- End quote ---
probably somewhere in /usr/lib....


--- Quote from: jpapot on July 07, 2015, 10:22:30 pm ---2) I searched where in the computer is the SDL library. I founded this : /usr/lib/i386-linux-gnu/libSDL-1.2.so.0.11.4   Is it the library I need ? It's not a .a or .so or .lib

--- End quote ---
probably there is somewhere a symlink to a libSDL.... (you can google that to)

the simple way is probably:
you can also use the

--- Code: ---`sdl-config --libs`
--- End code ---
command. Copy it (with the single quotes) to Project->Build options->Linker settings-> Other Linker options
and

--- Code: ---`sdl-config --cflags`
--- End code ---
to  Project->Build options-> Compiler Settings-> Other options (also with the quotes)
This will tell c::b all necessary cflags (compiler flags like include directories) and libs (also the path)

Note: i have never used SDL, so this information can be outdated, or non functional... You can search the c::b forum for SDL and you will find tons of answers...

greetings

Jenna:
If there is only the versioned *.so.xxx-file but not he symlink to *.so, it usually means that the development-package(s) is/are missing on your system.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version