[SVN 1623] Compile error on Fedora 12

Bugs that should be fixed in the latest SVN revision.

Moderators: FluXy, SMC Team, MVP

[SVN 1623] Compile error on Fedora 12

Postby JasonWoof » 25 Jan 2010 06:33

Trivial changes were introduced at rev 1587 that make it so smc will no longer compile for me (on Fedora 12). Here's interesting part of "make" output:

core/main.cpp: In function 'void SMC::Exit_Game()':
core/main.cpp:494: error: 'IMG_Quit' was not declared in this scope

I figured smc would run fine without that call, so I removed it. Then I got basically the same error from core/video/video.cpp. smc seemed to compile and run fine with both of those offending lines removed.

My first guess is that it's a namespace issue, but I'll let you figure it out.

So you can easily find these two troublesome lines, here's a patch that comments them both out:

Code: Select all
diff --git a/src/core/main.cpp b/src/core/main.cpp
index 4f30ff8..5dde1eb 100644
--- a/src/core/main.cpp
+++ b/src/core/main.cpp
@@ -486,7 +486,7 @@ void Exit_Game( void )
    }
 
    // unload the sdl_image preloaded libraries
-   IMG_Quit();
+   // FIXME: This is not defined: IMG_Quit();
 
    SDL_Quit();
 }
diff --git a/src/video/video.cpp b/src/video/video.cpp
index ae48a30..e0d99a0 100644
--- a/src/video/video.cpp
+++ b/src/video/video.cpp
@@ -228,7 +228,7 @@ void cVideo :: Init_SDL( void )
    }
 
    // preload the sdl_image png library
-   IMG_Init( IMG_INIT_PNG );
+   // FIXME: This is not defined: IMG_Init( IMG_INIT_PNG );
 
    SDL_EnableUNICODE( 1 );
    // hide by default

(that's against SVN 1623)
User avatar
JasonWoof
Turtle Shell red
Turtle Shell red
 
Posts: 18
Joined: 19 Oct 2008 21:25

Re: [SVN 1623] Compile error on Fedora 12

Postby BowserJr » 25 Jan 2010 08:51

Yeah, lots of people have been reporting this, and it's caused by not having the latest version of SDL_IMAGE. I'll make a sticky about it in Help.
"Plants need to have water poured on them because they have no hands to hold glasses of water."
User avatar
BowserJr
SMC Team
SMC Team
 
Posts: 1543
Joined: 05 Feb 2007 14:07
Location: London, UK

Re: [SVN 1623] Compile error on Fedora 12

Postby mrvertigo27 » 25 Jan 2010 16:19

I would like to add that this happens with no reguard to Operating system, I have seen this issue on windows, several flavors of Linux but as yet I have not personally seen this on a Mac. As BowserJr said this is a transitional issue and will be resolved before a stable release is made. The fix is simple enough and should work well for all users.
I'm A YouTube Gaming Commentator https://www.youtube.com/user/Spitfire25565
User avatar
mrvertigo27
SMC Team
SMC Team
 
Posts: 2299
Joined: 20 Aug 2009 16:10
Location: the state of insanity

Re: [SVN 1623] Compile error on Fedora 12

Postby JasonWoof » 25 Jan 2010 20:31

Ahh, OK. Glad you're on top of this one. I didn't realize it was SDL_image version specific. So the older versions of SDL_image doesn't have these symbols at all? Guess we could check for that with autoconf... you're call whether that's worth doing.
User avatar
JasonWoof
Turtle Shell red
Turtle Shell red
 
Posts: 18
Joined: 19 Oct 2008 21:25

Re: [SVN 1623] Compile error on Fedora 12

Postby mrvertigo27 » 25 Jan 2010 21:08

I dont think its worth it right now simply because the issue will only last a short time. plus there is a patch for this already and anyone with the know how to make and install from svn probably has the knowledge to come here looking for answers.


but then again I code in C# and web languages not c++ so i know nothing compared to the great ones :lol: :roll: :D
I'm A YouTube Gaming Commentator https://www.youtube.com/user/Spitfire25565
User avatar
mrvertigo27
SMC Team
SMC Team
 
Posts: 2299
Joined: 20 Aug 2009 16:10
Location: the state of insanity

Re: [SVN 1623] Compile error on Fedora 12

Postby JasonWoof » 26 Jan 2010 03:10

OK, I just looked it up. I have SDL_image 1.2.7, and the IMG_Init() and IMG_Quit() functions were added in 1.2.8.

So SMC requires SDL_image >= 1.2.8. Here's a small patch to make ./configure check for this:

Code: Select all
diff --git a/configure.ac b/configure.ac
index 75e3aaa..b2866cd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -43,6 +43,8 @@ AC_CHECK_LIB(png, png_init_io, ,
 # Check for the SDL_image library
 AC_CHECK_LIB(SDL_image, IMG_LoadPNG_RW, ,
        AC_MSG_ERROR([SDL_image library with PNG support not found]))
+AC_CHECK_LIB(SDL_image, IMG_Init, ,
+       AC_MSG_ERROR([SDL_image library must be >= 1.2.8]))
 
 # Check for the SDL_mixer library
 AC_CHECK_LIB(SDL_mixer, Mix_OpenAudio, ,

No changes to the source files are needed, just need to check for the versions of libraries you actually require. So with this change in place, people will stop thinking this is a bug, and go upgrade their SDL_image, or hack the code so older versions still work.
User avatar
JasonWoof
Turtle Shell red
Turtle Shell red
 
Posts: 18
Joined: 19 Oct 2008 21:25

Re: [SVN 1623] Compile error on Fedora 12

Postby FluXy » 08 Feb 2010 10:06

JasonWoof wrote:So SMC requires SDL_image >= 1.2.8. Here's a small patch to make ./configure check for this:


Thanks and it's in SVN 1626 :)
If i didn't read your post but it was important you can send me a PM.
Any Donation will help this project!
User avatar
FluXy
Admin
Admin
 
Posts: 2857
Joined: 04 May 2004 19:44
Location: Germany

Re: [SVN 1623] Compile error on Fedora 12

Postby Luiji » 18 Feb 2010 01:12

JasonWoof wrote:OK, I just looked it up. I have SDL_image 1.2.7, and the IMG_Init() and IMG_Quit() functions were added in 1.2.8.

So SMC requires SDL_image >= 1.2.8. Here's a small patch to make ./configure check for this:

Code: Select all
diff --git a/configure.ac b/configure.ac
index 75e3aaa..b2866cd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -43,6 +43,8 @@ AC_CHECK_LIB(png, png_init_io, ,
 # Check for the SDL_image library
 AC_CHECK_LIB(SDL_image, IMG_LoadPNG_RW, ,
        AC_MSG_ERROR([SDL_image library with PNG support not found]))
+AC_CHECK_LIB(SDL_image, IMG_Init, ,
+       AC_MSG_ERROR([SDL_image library must be >= 1.2.8]))
 
 # Check for the SDL_mixer library
 AC_CHECK_LIB(SDL_mixer, Mix_OpenAudio, ,

No changes to the source files are needed, just need to check for the versions of libraries you actually require. So with this change in place, people will stop thinking this is a bug, and go upgrade their SDL_image, or hack the code so older versions still work.


It would like to say that this patch broke SMC for me, as it cannot find IMG_Init, even with version 1.2.14 of SDL.

More information can be found at: [url]viewtopic.php?f=22&t=3290&p=19515#p19515[/url]
If you've submitted a Release level and I haven't added to the level repository in over a weak, I probably missed it and you should PM me if you want it uploaded.

Dell Inspiron 1440 (Arch Linux)
Dell Inspiron 11z (Arch Linux)
Dell OptiPlex 745 (Arch Linux)
Mac Mini (Mac OS X 10.6, Windows 7)
Dell Dimension 4500S (FreeBSD)
User avatar
Luiji
MVP
MVP
 
Posts: 2684
Joined: 14 Jan 2010 23:20
Location: The Mushroom Kyngdom


Return to Fixed

Who is online

Users browsing this forum: No registered users and 0 guests

cron