Archived

This topic is now archived and is closed to further replies.

C++BuilderX + SDL

This topic is 5134 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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.

Share this post


Link to post
Share on other sites