RE: compile problem using SDL library

Aurelien Marchand <[email protected]> Mon, 15 Jul 2002 16:08:22 -0400
Newsgroups gmane.comp.handhelds.zaurus.devel
Message-ID <C080BD3E63CFD211BF4E0008C7F40F3009642E41@tor-exch-001.researchcapital.com>
I think I found out what was the problem. 

I added a few "define"s in the Makefile and it compiled without a hitch.

I added this:

-DQWS -DDISABLE_X11

Now I can compile SDL programs for the zaurus! Joy!!

Aurelien

> -----Original Message-----
> From: David Hedbor [mailto:[email protected]]
> Sent: Thursday, July 11, 2002 4:48 PM
> To: Aurelien Marchand
> Cc: '[email protected]'
> Subject: Re: [Zaurus-devel] compile problem using SDL library
> 
> 
> Aurelien Marchand <[email protected]> writes:
> 
> > 1.  (*) text/plain ( ) text/html
> >
> > Hi all,
> >
> > I am trying to compile a program using the SDL library. I 
> am currently
> > cross-compiling from Linux to the Zaurus (arm platform).  
> The SDL I am
> > using is the CVS version (1.2.5), it also includes 
> SDL_mixer and both
> > are compiled for use with the Zaurus (according to the README.Qtopia
> > coming from the SDL CVS).
> >
> > I notice that the sdl-config generated also includes -Dmain=SDL_main
> > when you run sdl-config --libs, contrary to the x86 version but
> > anyways, when the .cc is compiled into an object, it is 
> done using the
> > -Dmain=SDL_main macro. Running "nm -s program.o" shows that SDL_main
> > is defined in it. But whenever I want to create the binary, 
> using all
> > the other .o (also compiled with -Dmain=SDL_main but it should be a
> > problem), plus all the library required, plus `sdl-config --libs`, I
> > receive an error message stating:
> >
> > /opt/Qtopia/sharp/lib/libSDLmain.a(SDL_Qtopia_main.o): In function
> > `main': /home/zaurus/sources/SDL12/src/main/SDL_Qtopia_main.cc:27:
> > undefined reference to `SDL_main' collect2: ld returned 1 
> exit status
> >
> > Could someone provide some information as to how to resolve the
> > problem and why is it happening?
> >
> > Indeed, running "nm -s libSDLmain.a" shows that is defines the main
> > function but asked for SDL_main. Since program.o contains 
> it, I don't
> > understand why runing: "g++ program.o (...) -lSDLmain" refuses to
> > work.
> 
> Could this be because you use c++? Try making the main method use
> extern "C" perhaps? Also how did you declare your main method
> (arguments etc)? 
> 
> I should note that SDL_main is required because it is what takes care
> of setting up the Qtopia environment.
> 
> -- 
> [ Below is a random fortune, which is unrelated to the above 
> message. ]
> Bower's Law:
> 	Talent goes where the action is.
> 

This email and any files transmitted with it are privileged, confidential, subject to copyright and intended solely for the use of the individual or entity to whom they are addressed. Views expressed are those of the user and not necessarily those of Research Capital Corporation or its subsidiaries. Any unauthorized use, copying, review or disclosure is prohibited. Please notify the sender immediately if you have received this communication in error. Thank you for your assistance and co-operation. 
Le présent message électronique (y compris les pièces qui y sont annexées, le cas échéant) s'adresse au destinataire indiqué et peut contenir des renseignements à caractère privé ou confidentiel. Les opinions exprimées sont celles de l'utilisateur et non pas nécessairement celles de Research Capital Corporation ou de ses filiales.  Si vous n'êtes pas le destinataire légitime de ce document, veuillez noter qu'il est strictement interdit de le diffuser, de le distribuer ou de le reproduire. Si ce message vous a été transmis par erreur, veuillez en informer l'expéditeur et le supprimer immédiatement. Merci de votre aide et de votre coopération.