#### Archived

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

# ::BEWARE:: Newbie question contained**

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

## Recommended Posts

Hello all, I''ve only recently started to fiddle with this "linux" stuff. However, my utter newbism is making it hard to figure a few things out. I need to know Where are the GCC includes and libraries kept? In my Win32 Borland compiler, they''re all nicely kept together in C:\Borland\include and C:\Borland\lib\ but I can''t seem to figure out the equivilants in crazy ol'' linux. Actually, I''m trying to figure out how to set up SDL so I can 1) do some windows programming, and 2) try to learn SDL. I installed the SDL rpm, but I don''t know how to do things from there. ANy hElp = ThNx

##### Share on other sites
I''m not a unix bod, but I think includes are in /usr/local/include.

Hope this helps.

How To Ask Questions The Smart Way | Google can help with your question | Search MSDN for help with standard C or Windows functions

##### Share on other sites
the includes and libs are usually in /usr/include and /usr/lib respectivelly, some may be on /usr/local/include and /usr/local/lib.

usually the package manager creates system variables so you dont really need to know where they are.

Regarding 1: you dont do "Windows" programing with SDL if you are refering to standard Applications with textboxes, comboboxes, and such, you will need X, GTK+ or wmWindows (the later being cross platform).

About 2: Read the documentation on www.libsdl.org, the Doc Project, the documentation that is available in multiple languages is quite useless, there are some tutorials on cone3d.gamedev.net and NeHe has some SDL ports as well if you are into OpenGL.

for compiling:
gcc -c yourcode.cpp sdl-config --cflags

gcc yourcode.o sdl-config --libs -lGL -lGLU -o yourcode

-lGL -lGLU is only needed if using OpenGL, you need to link with other libs you might need like -lstdc++ or -lm.

##### Share on other sites
/usr/lib
/usr/include

contrary to the way its done on crazy ole windows, *nix headers and libraries are "global"... although if a compiler WERE to keep its own headers/libraries... They''d probably be under /usr/share/name_of_weird_compiler/include

Just for reference All the major compilers for nix (gcc, *bsd''s cc, egcs) will use /usr/include and /usr/lib

Windows programming? on nix? I hope you mean Xwindows, otherwise thats just weird.

--

As for SDL, You say you installed the rpm? well... write your SDL program and compile it like

gcc file.c -o program -lSDL
-or-
gcc file.c -o program sdl-config --c-flags

Can''t remember if SDL uses that system or not... anybody who''s not working off of memory here care to tell which one it is?

##### Share on other sites
holy responses, batman!

when I started writing there weren''t any...

this place gets lurked a lot i guess

##### Share on other sites
OK, I think I may still be a little lost. Let me get this straight =-) In /usr/include, all the files are *.la''s or *.so''s, so I''m guessing these are equivalents to *.libs and *.dlls?

Also, in my /usr/include/ folder, I checked and there is no SDL.h file (though there were 2 library files for it). I''ll try reading up on the install documentation, though.

Also, for the record, I neglected to capitolize the unholy ''w'' in windows, implying a more generic sense of the word. I could have said "non-MicroSoft graphical environment-based programming", but I just figured "w****** programming" would suffice. I apologize if I have offended anyone =-)

Lastly, thankyuu all for your prompt responses =-)

##### Share on other sites
Hrmm....

I tried both

gcc file.c -o program -lSDL
gcc file.c -o program sdl-config --c-flags

but the first one simply didn''t work and the second one yelled angrily at me, telling me BASH couldn''t find sdl-config. I''m still playing with it though.

##### Share on other sites
quote:
Original post by Tac-Tics
Hrmm....

I tried both

gcc file.c -o program -lSDL
gcc file.c -o program sdl-config --c-flags

but the first one simply didn''t work and the second one yelled angrily at me, telling me BASH couldn''t find sdl-config. I''m still playing with it though.

This would seem to indicate that you haven''t yet installed SDL...

-- Aaron

| HollowWorks.com | Rhott.com |

##### Share on other sites
there are 2 packages on your redhat instalation CDs, SDL and SDL-devel. the first one is needed to RUN programs made with SDL, the later is for Developing apps using SDL (IE Make the programs), install both, then try to look for SDL.h, think of them as you think of the DirectX Runtime libs and the DirectX SDK.

# where SDL.h

should tell you where SDL.h is, otherwhise you can use

# find / -name "SDL.h"

##### Share on other sites
Aighty, obviously I shouldn't rely on RPM's to do anything useful =-/ I successfully compiled it from the source code and threw together a sample program and I got a nice, blank windo....err... Xwindow ^_^

Anyway, I might as well inquire furthur. I tried grafting OpenGL to my little SDL program, but I found something out: the glu.h is missing =-( I tried #include <glu.h> and #include <GL/glu.h> and looked hard through /usr/include/ but to no avail. So, I guess now I should ask:
1) am I REALLY missing glu.h? Would there be any way it didn't come with my version of Lin (Mandrake distro)?
and
2) how do I find/get glu.h? Can I just find a copy and throw it in my /usr/include/ dir? Or is there some other way that would be more proper to installing it?

::EDIT::
Also, I should note. When I try to compile a test program with OpenGL and SDL, I get the following errors:

Xlib: extension "GLX" missing on display ":0.0".
Xlib: extension "GLX" missing on display ":0.0".

Can anyone explain to me what these might mean? I can provide the source if I need to.

[edited by - Tac-Tics on June 28, 2002 2:28:02 AM]

1. 1
2. 2
JoeJ
20
3. 3
4. 4
frob
12
5. 5

• 13
• 19
• 13
• 20
• 13
• ### Forum Statistics

• Total Topics
632194
• Total Posts
3004692

×