Forum: Geek Forum Topic: SDL help, also GCC help started by: demonk Posted by demonk on Aug. 01 2001,18:00
Ok, if you don't know what SDL is, go here < http://www.libsdl.org > I've used Cygwin and Mingw32 for compiling my programs. I like the ideas of being able to write a high end 3D program using completely free software. Take that M$! Anyway, back to my question. I'm trying to get OpenGL support into my program. Right now all I'm trying to do is get it to open a black window and wait until I hit escape, when it will quit. When I compile the source code, it gives me no errors. But when it goes to link the objects and make a executable, I get all these errors that all the OpenGL calls are undefined. I just can't understand for the life of me how to get this to work. I have the gl.h and glu.h files, and since it compiles it must be finding the headers. Has anyone ever tried this, or has any ideas to help me? ------------------ Posted by demonk on Aug. 01 2001,18:03
Correct that, it also does it during compile. Just started doing that too.------------------ Posted by RenegadeSnark on Aug. 01 2001,20:18
I don't know what kind of experience you have with programming, so I'll throw two "newbie mistakes" your way in the hopes that one or both help.First of all - if your program is using a different calling convention than the library the header files describes, you need to change it. (If the library was compiled as C and your program is C++, put extern "C" { } around the entries in the .h files) Also - make sure you are linking the library. The order does hold significance for some linkers in what files are passed - try passing it more than once and on the end and beginning and all over. Posted by demonk on Aug. 01 2001,21:02
Well, I'm trying to compile an EXAMPLE from the SDL website. I've been looking at the gl.h file, and it seems to have been written in C++ since there is an extern C{ near the top. I don't even think it is linking. I think it finds the header file just fine, but it can't seem to find the libraries at all. I've tried copying them to several lib/ directories all over the place, and it still won't find them.I have SOME experience with C, almost nill with C++, and way too much with Java. My @$#\% CS program at school really leans on Java for entry level classes. $\%#@ ruins everyone who goes through them. IF YOU ARE THINKING OF BEING A CS MAJOR, DO NOT GOTO OREGON STATE UNIVERSITY!!! Of cource, they make up for it with great engineering majors. Anyway, most of the C experience has been through a GUI called Code Warrior, which I HAD to use to turn in my assignments. Now I've switched to a straight text editor with a little bit of color highlighting, so I'm doing all my own compiling and linking by hand. With SDL, when you compile a program, they say you should use this command sequence: gcc <source> -o <destination> `sdl-config --cflags --libs` That last part returns linking and other such commands. This is where I think I'm getting hung up. Anyway, I really need specific help, not just general advice. ------------------ Posted by damien_s_lucifer on Aug. 02 2001,00:19
what text editor w/color highlighting do you use? I need one for Winblows.For linux, jed owns j00. Posted by demonk on Aug. 02 2001,13:05
I use a program called TextPad. Just search on Yahoo for it, you'll find it. It does color coding for a lot of languages, like C, C++, perl, HTML, XML, php, etc, etc. Very small, very fast.------------------ Posted by RenegadeSnark on Aug. 03 2001,02:27
Try running this from the command line:sdl-config --cflags --libs Post what it returns. Posted by RenegadeSnark on Aug. 03 2001,02:29
Code Warrior is arguably the worst compiler in the history of the world.That is all. Posted by damien_s_lucifer on Aug. 03 2001,03:38
wow. < textpad > owns.
Posted by demonk on Aug. 05 2001,15:13
Yup, textpad is the king of simple text editors.Here is what I get when I run sdl-config --cflags --libs -I/usr/local/include -I/usr/local/include/SDL -Dmain=SDL_main -I/usr/include/mingw -DWIN32 -Uunix I've also recently seen an example of how to compile this program I want to compile under Linux\SDL. I added an extra couple of options: -lGL -lGLU When I added that, I get a new error. Now it says it cannot find -lGL. Don't know what to do. This message has been edited by demonk on August 06, 2001 at 10:15 AM Posted by Tattered on Aug. 06 2001,00:47
UltimateEdit.. winblows texteditor.. with color highlights for everything.. even html.
Posted by L33T_h4x0r_d00d on Aug. 06 2001,01:11
quote: I second that. ------------------ Posted by demonk on Aug. 06 2001,01:53
quote: Put me down too. |