SDL-0.9.13 binary

Hello!

I have just tried installing SDL v.0.9.13 binary
for linux. My apps seems to compile just fine,
however when running an app I get an error. Something
like:

Error loading libSDLx11.0.9.so: Cannot find: libesd.so

(Or maybe it was libeds.so)

When trying to cross-compile from Linux to Win*
with SDL with 0.9.13 binary win32 (GCC) I get
a lot of compilation errors in my main file
(but only in this file) which doesn’t ususally
occur. When cross compiling again with v. 0.9.9
and the same crosscompiler, the errors disappear…
It looks really strange, but I’m guessing there
must be something wrong with a declaration of SDL_Init
or something:

The file spaceInvMain.cc:—
//
//
//
//
//
//
//

#include “spaceGameShell.h”
#include <stdio.h>
#include <stdlib.h>
#include <SDL.h>

int main(int argc, char *argv[])
{
spaceGameShell *shell;

/* Initialize the SDL library */
if ( SDL_Init(SDL_INIT_AUDIO|SDL_INIT_VIDEO) < 0 )
{
   puts(SDL_GetError());
   fprintf(stderr, "Couldn't initialize SDL: %s\n",SDL_GetError());
   exit(2);
}

shell = new spaceGameShell();
shell->checkedExec(argc, argv);
delete shell;

SDL_Quit();
exit(1);

}

Compiler errors:

spaceInvMain.cc:14: parse error before string constant
spaceInvMain.cc:22: warning: ANSI C++ forbids declaration
’fprintf’ with no type or storage class
spaceInvMain.cc:22: ‘int fprintf’ redeclared as different kind of symbol
/usr/win32/i686-pc-mingw32/include/stdio.h:191: previous declaration of
’int fprintf(struct _iobuf *, const char * …)'
spaceInvMain.cc:22: warning: initializer list being treated as compound
expression
spaceInvMain.cc:22: warning: initialization to ‘int’ from ‘char *’ lacks
a cast
spaceInvMain.cc:23: warning: ANSI C++ forbids declaration ‘exit’ with no
type
or storage class
spaceInvMain.cc:23: ‘int exit’ redeclared as different kind of symbol
/usr/win32/i686-pc-mingw32/include/stdlib.h:168: previous declaration of
’void exit(int)'
spaceInvMain.cc:24: parse error before }'
spaceInvMain.cc:26: warning: ANSI C++ forbids declaration ‘shell’ with
no
type or storage class
spaceInvMain.cc:26: warning: initialization to ‘int’ from
’spaceGameShell *'
lacks a cast
spaceInvMain.cc:27: syntax error before ->'
spaceInvMain.cc:30: new declaration ‘int SDL_Quit()’
/usr/local/include/SDL/SDL.h:78: ambiguates old declaration 'void
SDL_Quit()'
spaceInvMain.cc:31: warning: ANSI C++ forbids declaration ‘exit’ with no
type
or storage class
spaceInvMain.cc:31: redefinition of 'int exit’
spaceInvMain.cc:23: ‘int exit’ previously defined here
spaceInvMain.cc:32: parse error before }'
make: *** [spaceInvMain.o] Error 1

Cheers

http://www.HardcoreProcessing.com

I have just tried installing SDL v.0.9.13 binary
for linux. My apps seems to compile just fine,
however when running an app I get an error. Something
like:

Error loading libSDLx11.0.9.so: Cannot find: libesd.so

Yeah, I accidentally added ESD support to the distributed Linux binary.
Rebuilding from source will fix that.

When trying to cross-compile from Linux to Win*
with SDL with 0.9.13 binary win32 (GCC) I get
a lot of compilation errors in my main file
(but only in this file) which doesn’t ususally
occur. When cross compiling again with v. 0.9.9
and the same crosscompiler, the errors disappear…
It looks really strange, but I’m guessing there
must be something wrong with a declaration of SDL_Init
or something:

int main(int argc, char *argv[])
{

This is in the FAQ and WhatsNew…
The main declaration was changed to support Visual C++.
It should be:

main(int argc, char *argv[])
{

-Sam Lantinga				(slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

Sam Lantinga wrote:

Yeah, I accidentally added ESD support to the distributed Linux binary.
Rebuilding from source will fix that.

OK, thanks - I’ll se if I can manage a rebuild :slight_smile:

int main(int argc, char *argv[])
{

This is in the FAQ and WhatsNew…
The main declaration was changed to support Visual C++.
It should be:

main(int argc, char *argv[])
{

Oops, sorry for not having read that :slight_smile:

However, this is a change to a stanard
function in C - how can you change that
in SDL? And more importantly - is it wise
to do so?

However I don’t care right now :slight_smile:

Thanks for your help!

Cheers–
http://www.HardcoreProcessing.com

main(int argc, char *argv[])
{

Oops, sorry for not having read that :slight_smile:

No worries, it’s easy to miss.

However, this is a change to a stanard
function in C - how can you change that
in SDL? And more importantly - is it wise
to do so?

I don’t know. But I do know that it’s the only way I was able
to get VC++ to call the SDL main() instead of yours for console
applications, without forcing you to use a different “main” function.

Ideas are always welcome. :slight_smile:

Thanks for your help!

You’re welcome!

-Sam Lantinga				(slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

However, this is a change to a stanard
function in C - how can you change that
in SDL? And more importantly - is it wise
to do so?

That’s where you’re wrong; In *nix (where * == Linux, and most others) main
returns an int, which in Linux, and a few others, is the return value of the
program.

Well, in Win32, it seems main() doesn’t have the same semantics…On Sat, Jul 17, 1999 at 03:06:02PM +0200, ANOQ of the Sun wrote:


– Michael Samuel

Well, in Win32, it seems main() doesn’t have the same semantics…

Actually, it does. Well, it returns int.
But, in a console environment, your main overrides SDL’s main, so SDL
redefines it as RunMain(), and the definition doesn’t work properly if
you have a return type there. It’s ugly, and I don’t remember all of
the nuances, but if you do it any other way, it breaks.

BTW, on Win32 and MacOS, SDL needs to do some initialization before
your application runs, or it will not be able to work properly.

-Sam Lantinga				(slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

Is the Visual C zip file is broken form CVS?
i grab myself the copy from the cvs tarball from the main sdll site
and that one was ok. with my wincvs (the latest beta) the zip
file give me a error when trying to uncompres!

No, the zip file is fine, I just checked. Is wincvs trying to convert
it as if it were a text file?

-Sam Lantinga				(slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

Is the Visual C zip file is broken form CVS?
i grab myself the copy from the cvs tarball from the main sdll site
and that one was ok. with my wincvs (the latest beta) the zip
file give me a error when trying to uncompres!
----- Oorspronkelijk bericht -----
Van: Sam Lantinga
Aan:
Verzonden: zondag 25 juli 1999 22:09
Onderwerp: Re: [SDL] SDL-0.9.13 binary…> > Well, in Win32, it seems main() doesn’t have the same semantics…

Actually, it does. Well, it returns int.
But, in a console environment, your main overrides SDL’s main, so SDL
redefines it as RunMain(), and the definition doesn’t work properly if
you have a return type there. It’s ugly, and I don’t remember all of
the nuances, but if you do it any other way, it breaks.

BTW, on Win32 and MacOS, SDL needs to do some initialization before
your application runs, or it will not be able to work properly.

-Sam Lantinga (slouken at devolution.com)

Lead Programmer, Loki Entertainment Software

“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

In WinCVS i have the following options in the modules:
SDL VisualC.zip does not -rb (binary) option
SDL-demos VisualC.zip has -rb

and the file is offcourse OK in the demos directory,

i solved it by manipulating the entries file in the CVS folder
off SDL module
old situation : /VisualC.zip/1.9/Mon Jul 26 23:45:18 1999//
new situation : /VisualC.zip/1.9/Mon Jul 26 23:45:18 1999/-kb/

hopes it helps the wincvs users. (and i know there is another way
but i always want to get the job done fast, with the same end-results :wink:

and after an remove of the old file and a fresh update the option
-kb or binary stayed!
----- Oorspronkelijk bericht -----
Van: Sam Lantinga
Aan:
Verzonden: maandag 26 juli 1999 1:11
Onderwerp: Re: [SDL] SDL-0.9.13 binary…> > Is the Visual C zip file is broken form CVS?

i grab myself the copy from the cvs tarball from the main sdll site
and that one was ok. with my wincvs (the latest beta) the zip
file give me a error when trying to uncompres!

No, the zip file is fine, I just checked. Is wincvs trying to convert
it as if it were a text file?

-Sam Lantinga (slouken at devolution.com)

Lead Programmer, Loki Entertainment Software

“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

Actually, defining main() as:

 main() {
    }
 
 implies a return value of int.  That's true of any C function: the 
 default return type is "int".  However, apparently, the Windows 
 compiler stores a different "signature" if you explicitly specify 
 "int", so it cannot link with the function you supplied(?)
 
 Warren

______________________________ Reply Separator _________________________________Subject: Re: [SDL] SDL-0.9.13 binary…
Author: at internet-mail
Date: 7/26/99 2:40 AM

On Sat, Jul 17, 1999 at 03:06:02PM +0200, ANOQ of the Sun wrote:

However, this is a change to a stanard
function in C - how can you change that
in SDL? And more importantly - is it wise
to do so?

That’s where you’re wrong; In *nix (where * == Linux, and most others) main
returns an int, which in Linux, and a few others, is the return value of the
program.

Well, in Win32, it seems main() doesn’t have the same semantics…


– Michael Samuel

 Actually, defining main() as:
 
 main() {
    }
 
 implies a return value of int.  That's true of any C function: the 
 default return type is "int".  However, apparently, the Windows 
 compiler stores a different "signature" if you explicitly specify 
 "int", so it cannot link with the function you supplied(?)

Not really. It’s a macro hack.
Take a look at SDL_mangle.h if you are brave. :slight_smile:

-Sam Lantinga				(slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec