Search Members Help

» Welcome Guest
[ Log In :: Register ]

Page 1 of 212>>

[ Track This Topic :: Email This Topic :: Print this topic ]

reply to topic new topic new poll
Topic: SDL help, also GCC help< Next Oldest | Next Newest >
 Post Number: 1
demonk Search for posts by this member.
The other white meat
Avatar



Group: Members
Posts: 800
Joined: Aug. 2000
PostIcon Posted on: Aug. 01 2001,18:00  Skip to the next post in this topic. Ignore posts   QUOTE

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?

------------------
10 PRINT "HOME"
20 PRINT "SWEET"
30 GOTO 10

Offline
Top of Page Profile Contact Info WEB 
 Post Number: 2
demonk Search for posts by this member.
The other white meat
Avatar



Group: Members
Posts: 800
Joined: Aug. 2000
PostIcon Posted on: Aug. 01 2001,18:03 Skip to the previous post in this topic. Skip to the next post in this topic. Ignore posts   QUOTE

Correct that, it also does it during compile. Just started doing that too.

------------------
10 PRINT "HOME"
20 PRINT "SWEET"
30 GOTO 10

Offline
Top of Page Profile Contact Info WEB 
 Post Number: 3
RenegadeSnark Search for posts by this member.
Old School
Avatar



Group: Members
Posts: 534
Joined: May 2000
PostIcon Posted on: Aug. 01 2001,20:18 Skip to the previous post in this topic. Skip to the next post in this topic. Ignore posts   QUOTE

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.

Offline
Top of Page Profile Contact Info 
 Post Number: 4
demonk Search for posts by this member.
The other white meat
Avatar



Group: Members
Posts: 800
Joined: Aug. 2000
PostIcon Posted on: Aug. 01 2001,21:02 Skip to the previous post in this topic. Skip to the next post in this topic. Ignore posts   QUOTE

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.

------------------
10 PRINT "HOME"
20 PRINT "SWEET"
30 GOTO 10

Offline
Top of Page Profile Contact Info WEB 
 Post Number: 5
damien_s_lucifer Search for posts by this member.
Emperor of Detnet
Avatar



Group: Members
Posts: 33
Joined: Jan. 1970
PostIcon Posted on: Aug. 02 2001,00:19 Skip to the previous post in this topic. Skip to the next post in this topic. Ignore posts   QUOTE

what text editor w/color highlighting do you use? I need one for Winblows.

For linux, jed owns j00.

Offline
Top of Page Profile Contact Info WEB 
 Post Number: 6
demonk Search for posts by this member.
The other white meat
Avatar



Group: Members
Posts: 800
Joined: Aug. 2000
PostIcon Posted on: Aug. 02 2001,13:05 Skip to the previous post in this topic. Skip to the next post in this topic. Ignore posts   QUOTE

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.

------------------
10 PRINT "HOME"
20 PRINT "SWEET"
30 GOTO 10

Offline
Top of Page Profile Contact Info WEB 
 Post Number: 7
RenegadeSnark Search for posts by this member.
Old School
Avatar



Group: Members
Posts: 534
Joined: May 2000
PostIcon Posted on: Aug. 03 2001,02:27 Skip to the previous post in this topic. Skip to the next post in this topic. Ignore posts   QUOTE

Try running this from the command line:

sdl-config --cflags --libs

Post what it returns.

Offline
Top of Page Profile Contact Info 
 Post Number: 8
RenegadeSnark Search for posts by this member.
Old School
Avatar



Group: Members
Posts: 534
Joined: May 2000
PostIcon Posted on: Aug. 03 2001,02:29 Skip to the previous post in this topic. Skip to the next post in this topic. Ignore posts   QUOTE

Code Warrior is arguably the worst compiler in the history of the world.

That is all.

Offline
Top of Page Profile Contact Info 
 Post Number: 9
damien_s_lucifer Search for posts by this member.
Emperor of Detnet
Avatar



Group: Members
Posts: 33
Joined: Jan. 1970
PostIcon Posted on: Aug. 03 2001,03:38 Skip to the previous post in this topic. Skip to the next post in this topic. Ignore posts   QUOTE

wow. textpad owns.
Offline
Top of Page Profile Contact Info WEB 
 Post Number: 10
demonk Search for posts by this member.
The other white meat
Avatar



Group: Members
Posts: 800
Joined: Aug. 2000
PostIcon Posted on: Aug. 05 2001,15:13 Skip to the previous post in this topic.  Ignore posts   QUOTE

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
-L/usr/local/lib -lmingw32 -lSDLmain -mwindows -mno-cygwin

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.
------------------
10 PRINT "HOME"
20 PRINT "SWEET"
30 GOTO 10

This message has been edited by demonk on August 06, 2001 at 10:15 AM

Offline
Top of Page Profile Contact Info WEB 
12 replies since Aug. 01 2001,18:00 < Next Oldest | Next Newest >

[ Track This Topic :: Email This Topic :: Print this topic ]


Page 1 of 212>>
reply to topic new topic new poll

» Quick Reply SDL help, also GCC help
iB Code Buttons
You are posting as:

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code