Advertisement

C++BuilderX + SDL

Started by November 26, 2003 07:10 PM
2 comments, last by Arkainium 20 years, 10 months ago
This is the first IDE I''ve come across in Linux that I really like the feel of. However, I''m having some trouble getting SDL programs to compile/link... if only I could directly hand edit the compile and link options. :-/ Anyway, I''d greatly appreciate if anyone that got these two working together could throw me a few pointers. Thanks.
I just recently started using C++BuilderX. I''m sure there''s a way of doing it well with the project generated by the IDE, but since my SDL program already had a Makefile which works with SDL, I just set the project to use the Makefile.

However you do it, your going to have to get the final linking call to g++ to add `sdl-config --libs` at the end. For example, in my Makefile, I have
LDFLAGS = `sdl-config --libs` -lGL


The official zorx website
Zorx (a Puzzle Bobble clone)Discontinuity (an animation system for POV-Ray)
Advertisement
Yea, I got it working with the generated project. I couldn''t do it the "lazy" way using sdl-config though. I had to set the directories, etc.

Using your own Makefile is not bad either. It''ll probably be quicker and you get maximum control.
Go to the build options explorer and select the linker command. Expand the "Linker Options" in options, press the little button with 3 dots at the option "Search for library LIBNAME (-l)", add the word SDL in the dialog box. Mark the checkbox to the right of the "Search for library...". Now your project should link with libSDL.

If it is complaining about the include files, select the compiler command line in the build options explorer. Expand "Directory options" in the "Options" tab. Add your SDL include dir in the "Add directory at to the end of the main of include path (-I)".

You should be all set now.

This topic is closed to new replies.

Advertisement