Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
02-02-2010, 05:09 PM
|
#1
|
|
LQ Newbie
Registered: May 2008
Distribution: Slackware/Slackintosh
Posts: 21
Rep:
|
Attempting to Cross-compile SDL_image with mingw on a linux host
Hi all,
I've written a few applications with SDL, and recently I've taken interest in porting them to win32 via mingw, hosted on my Slackware laptop.
I downloaded and installed mingw to my home directory, and I also downloaded the mingw32 SDL development pacakge ("SDL-devel-1.2.14-mingw32.tar.gz") from the SDL website. After installing it with proper prefixes, I can compile SDL programs with mingw and run them on a Windows box.
However, I'm having less luck with programs that use both SDL and SDL_image. There's no mingw32 development package on the SDL_image site as there is on the SDL site, so I'm a bit confused on how to proceed.
Should I download the source package and compile it with mingw? If so, how? The typical ./configure, make, make install uses gcc, not i686-pc-mingw-gcc, and attempting to specify it causes the configure script to complain that the compiler doesn't create valid binaries.
I've tried compiling with gcc and setting the prefixes to my mingw installation; I'm getting no luck with that, and I suspect it's the wrong road to take.
I would greatly appreciate any hints.
Thanks,
Eupator
|
|
|
|
02-02-2010, 06:21 PM
|
#2
|
|
Senior Member
Registered: Sep 2009
Location: Washington U.S.
Distribution: Damn Small Linux, KateOs, M$ Ickdows Vista, My own OS
Posts: 2,136
Rep: 
|
Download the visual C SDL image dev-kit.
|
|
|
|
02-03-2010, 07:12 AM
|
#3
|
|
LQ Newbie
Registered: May 2008
Distribution: Slackware/Slackintosh
Posts: 21
Original Poster
Rep:
|
Quote:
Originally Posted by smeezekitty
Download the visual C SDL image dev-kit.
|
Could you elaborate? I downloaded SDL_image-devel-1.2.10-VC.zip from http://www.libsdl.org/projects/SDL_image/ . I tried compiling it with gcc and installing to my mingw directory, but cross compiling still fails:
Code:
$ /home/me/mingw32/usr/bin/i686-pc-mingw32-gcc -o SDL_test.exe main.c `/home/me/mingw32/bin/sdl-config --cflags --libs` -lSDL_image
/tmp/cc8ukDpN.o:main.c:(.text+0x1a): undefined reference to `_IMG_Load'
collect2: ld returned 1 exit status
main.c contains only:
Code:
#include<stdio.h>
#include"SDL/SDL.h"
#include"SDL/SDL_image.h"
int main(int argc,char *argv[])
{
SDL_Surface *s;
printf("Hello, world!\n");
s=IMG_Load("test.png");
return;
}
Any ideas?
|
|
|
|
02-03-2010, 12:57 PM
|
#4
|
|
Senior Member
Registered: Sep 2009
Location: Washington U.S.
Distribution: Damn Small Linux, KateOs, M$ Ickdows Vista, My own OS
Posts: 2,136
Rep: 
|
|
|
|
|
02-03-2010, 03:47 PM
|
#5
|
|
LQ Newbie
Registered: May 2008
Distribution: Slackware/Slackintosh
Posts: 21
Original Poster
Rep:
|
Quote:
Originally Posted by smeezekitty
|
This returns the same error during linkage, with the name of one function replaced with another.
Code:
/tmp/ccMdPNbq.o:main.c:(.text+0x3a): undefined reference to `_IMG_LoadTyped_RW'
collect2: ld returned 1 exit status
Any other ideas?
|
|
|
|
02-03-2010, 04:33 PM
|
#6
|
|
Senior Member
Registered: Sep 2009
Location: Washington U.S.
Distribution: Damn Small Linux, KateOs, M$ Ickdows Vista, My own OS
Posts: 2,136
Rep: 
|
Add the flag -lSDLimage (or was it -lSDLImage) to the compiler / linker command line.
|
|
|
|
02-03-2010, 05:03 PM
|
#7
|
|
LQ Newbie
Registered: May 2008
Distribution: Slackware/Slackintosh
Posts: 21
Original Poster
Rep:
|
Quote:
Originally Posted by smeezekitty
Add the flag -lSDLimage (or was it -lSDLImage) to the compiler / linker command line.
|
I've been linking with -lSDL_image. Neither of the above libraries exist.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 08:01 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|