List Info

Thread: SDL Linux Help




SDL Linux Help
user name
2007-04-17 01:25:11
I'm running Kubuntu and KDevelop. I've had a little experience with Linux(with cygwin and jacking numerous linux installs up). I can compile my progs but for some reason I can't click on the executable and run it from folders. The only success I've had is from running the prog from a terminal ( ./prog ) from that directory or testing the prog from KDevelop. I think it may be an dll/lib finding issue but since I can run them I'm not sure if it's an install issue or simply a linux one. I love SDL and I've been trying to ease over to linux a bit since it's cross platform.
Re: SDL Linux Help
country flaguser name
United States
2007-04-17 01:35:54
On Tue, 17 Apr 2007 00:25:11 -0600
"Jonathan Greig" <redteam316gmail.com> wrote:

> I'm running Kubuntu and KDevelop. I've had a little
experience with
> Linux(with cygwin and jacking numerous linux installs
up). I can
> compile my progs but for some reason I can't click on
the executable
> and run it from folders. The only success I've had is
from running
> the prog from a terminal ( ./prog ) from that directory
or testing
> the prog from KDevelop. I think it may be an dll/lib
finding issue
> but since I can run them I'm not sure if it's an
install issue or
> simply a linux one. I love SDL and I've been trying to
ease over to
> linux a bit since it's cross platform.

what application are you using to click on it ?  i think
that depends
on the the file browser.  i can run my app in konqueror but
fails since
mine needs an argument.

matt
_______________________________________________
SDL mailing list
SDLlists.libsdl.org
h
ttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Re: SDL Linux Help
user name
2007-04-17 02:50:06
On 4/17/07, Jonathan Greig <redteam316gmail.com> wrote:
> I'm running Kubuntu and KDevelop. I've had a little
experience with
> Linux(with cygwin and jacking numerous linux installs
up). I can compile my
> progs but for some reason I can't click on the
executable and run it from
> folders. The only success I've had is from running the
prog from a terminal
> ( ./prog ) from that directory or testing the prog from
KDevelop. I think it
> may be an dll/lib finding issue but since I can run
them I'm not sure if
> it's an install issue or simply a linux one. I love SDL
and I've been trying
> to ease over to linux a bit since it's cross platform.

Try running it in a terminal from a different directory and
note the results.
Also note that double-click launching of a game should be
done using a
.desktop file in Linux, as it makes the desktop manager's
life much
easier (see freedesktop.org for info). You can even set a
command line
or current directory that way.
_______________________________________________
SDL mailing list
SDLlists.libsdl.org
h
ttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Re: SDL Linux Help
country flaguser name
Germany
2007-04-17 06:26:35
Hello,

I am running Kubuntu too and I have no problems... I think,
your problem is, that you do include some pictures or
anything else. If I'm right, you should create a shellscript
"start.sh" with the following lines:

#!/bin/bash

cd /where/your/prog/is
./myprog

Now type chmod +x start.sh

Then click on the script or however and it 'should' work...

See ya


-------- Original-Nachricht --------
Datum: Tue, 17 Apr 2007 00:25:11 -0600
Von: "Jonathan Greig" <redteam316gmail.com>
An: SDLlists.libsdl.org
Betreff: [SDL] SDL Linux Help

> I'm running Kubuntu and KDevelop. I've had a little
experience with
> Linux(with cygwin and jacking numerous linux installs
up). I can compile
> my
> progs but for some reason I can't click on the
executable and run it from
> folders. The only success I've had is from running the
prog from a
> terminal
> ( ./prog ) from that directory or testing the prog from
KDevelop. I think
> it
> may be an dll/lib finding issue but since I can run
them I'm not sure if
> it's an install issue or simply a linux one. I love SDL
and I've been
> trying
> to ease over to linux a bit since it's cross platform.

-- 
"Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat
...
Jetzt GMX TopMail testen: http://www.gmx.net/d
e/go/topmail
_______________________________________________
SDL mailing list
SDLlists.libsdl.org
h
ttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Re: SDL Linux Help
country flaguser name
Finland
2007-04-17 06:33:07
Hi,

Since when does a Unix application (C/C++ one) need a shell
script to start from the desktop?

That looks like you might have some path problems with your
libraries. Or validate that the x bit is set.

Cheers,
Paulo

Quoting Philipp Lorenz <descent1gmx.net>:

> Hello,
> 
> I am running Kubuntu too and I have no problems... I
think, your problem is,
> that you do include some pictures or anything else. If
I'm right, you should
> create a shellscript "start.sh" with the
following lines:
> 
> #!/bin/bash
> 
> cd /where/your/prog/is
> ./myprog
> 
> Now type chmod +x start.sh
> 
> Then click on the script or however and it 'should'
work...
> 
> See ya
> 
> 
> -------- Original-Nachricht --------
> Datum: Tue, 17 Apr 2007 00:25:11 -0600
> Von: "Jonathan Greig" <redteam316gmail.com>
> An: SDLlists.libsdl.org
> Betreff: [SDL] SDL Linux Help
> 
> > I'm running Kubuntu and KDevelop. I've had a
little experience with
> > Linux(with cygwin and jacking numerous linux
installs up). I can compile
> > my
> > progs but for some reason I can't click on the
executable and run it from
> > folders. The only success I've had is from running
the prog from a
> > terminal
> > ( ./prog ) from that directory or testing the prog
from KDevelop. I think
> > it
> > may be an dll/lib finding issue but since I can
run them I'm not sure if
> > it's an install issue or simply a linux one. I
love SDL and I've been
> > trying
> > to ease over to linux a bit since it's cross
platform.
> 
> -- 
> "Feel free" - 10 GB Mailbox, 100
FreeSMS/Monat ...
> Jetzt GMX TopMail testen: http://www.gmx.net/d
e/go/topmail
> _______________________________________________
> SDL mailing list
> SDLlists.libsdl.org
> h
ttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
> 




------------------------------------------------------------
----
This message was sent using IMP, the Internet Messaging
Program.
_______________________________________________
SDL mailing list
SDLlists.libsdl.org
h
ttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Re: SDL Linux Help
country flaguser name
United States
2007-04-17 09:24:05
On Tue, 17 Apr 2007 12:33:07 +0100
Paulo Pinto <pjmlpprogtools.org> wrote:

> Hi,
> 
> Since when does a Unix application (C/C++ one) need a
shell
> script to start from the desktop?

openoffice on gentoo uses a perl script as a wrapper.  i
have redhat
but not booted to that at the moment to check.

matt
_______________________________________________
SDL mailing list
SDLlists.libsdl.org
h
ttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Re: SDL Linux Help
user name
2007-04-17 17:58:00
Here is what happens in the konsole:

jpgkubuntu-computer:~/hellosdl/debug/src$ ./hellosdl
TESTING: _
jpgkubuntu-computer:~/hellosdl/debug/src$ cd ..
jpgkubuntu-computer:~/hellosdl/debug$ src/./hellosdl
Segmentation fault
jpgkubuntu-computer:~/hellosdl/debug$

It wont run from any directory other than it's own. I've had
problems
with segfaults on windows but usually those were caused by a
missing
graphic. I know thats not the case here though. My prog is
loading one
bitmap and it is there.

I made a helloworld prog and I could run helloworld fine
from any
directory as well as the "Run Command" menu.

On 4/17/07, matt <mattmattehearthlink.net> wrote:
> On Tue, 17 Apr 2007 12:33:07 +0100
> Paulo Pinto <pjmlpprogtools.org> wrote:
>
> > Hi,
> >
> > Since when does a Unix application (C/C++ one)
need a shell
> > script to start from the desktop?
>
> openoffice on gentoo uses a perl script as a wrapper. 
i have redhat
> but not booted to that at the moment to check.
>
> matt
> _______________________________________________
> SDL mailing list
> SDLlists.libsdl.org
> h
ttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>
_______________________________________________
SDL mailing list
SDLlists.libsdl.org
h
ttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Re: SDL Linux Help
user name
2007-04-17 18:48:42
Probaly your code are access protected memory address.

Example:

char x[50];
printf("%c", x[60]);

At windows it works. At linux, it result in a Segmentation
fault.

Maybe the problem is other, but ever i have Segmentation
fault was this problem.

Regards,

Rúben

On 4/17/07, Jonathan Greig <redteam316gmail.com> wrote:
> Here is what happens in the konsole:
>
> jpgkubuntu-computer:~/hellosdl/debug/src$ ./hellosdl
> TESTING: _
> jpgkubuntu-computer:~/hellosdl/debug/src$ cd ..
> jpgkubuntu-computer:~/hellosdl/debug$ src/./hellosdl
> Segmentation fault
> jpgkubuntu-computer:~/hellosdl/debug$
>
> It wont run from any directory other than it's own.
I've had problems
> with segfaults on windows but usually those were caused
by a missing
> graphic. I know thats not the case here though. My prog
is loading one
> bitmap and it is there.
>
> I made a helloworld prog and I could run helloworld
fine from any
> directory as well as the "Run Command" menu.
>
> On 4/17/07, matt <mattmattehearthlink.net> wrote:
> > On Tue, 17 Apr 2007 12:33:07 +0100
> > Paulo Pinto <pjmlpprogtools.org> wrote:
> >
> > > Hi,
> > >
> > > Since when does a Unix application (C/C++
one) need a shell
> > > script to start from the desktop?
> >
> > openoffice on gentoo uses a perl script as a
wrapper.  i have redhat
> > but not booted to that at the moment to check.
> >
> > matt
> > _______________________________________________
> > SDL mailing list
> > SDLlists.libsdl.org
> > h
ttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
> >
> _______________________________________________
> SDL mailing list
> SDLlists.libsdl.org
> h
ttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>


-- 
Rúben Lício Reis

Linux Game Developer
Linux user #433535
_______________________________________________
SDL mailing list
SDLlists.libsdl.org
h
ttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Re: SDL Linux Help
user name
2007-04-17 19:35:05
Interesting,
When I copy the graphic to the src folder, I can run my prog
from the
terminal by typing

src/./hellosdl

from the src directory, but I still cant double click it and
run my
prog from konqueror.

I downloaded krusader and it ran the prog just fine. I also
downloaded
Dolphin and it didn't work either. Is there some setting in
konqueror
that I have to update the search path to the directory that
the prog
is in(like on the fly) such as i.e. $PATH=PATH
DirectoryOfTheProgramIWantToRun ?
_______________________________________________
SDL mailing list
SDLlists.libsdl.org
h
ttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Re: SDL Linux Help
country flaguser name
United States
2007-04-17 22:58:36
On Tue, 17 Apr 2007 17:58:00 -0500
"Jonathan Greig" <redteam316gmail.com> wrote:

> Here is what happens in the konsole:
> 
> jpgkubuntu-computer:~/hellosdl/debug/src$ ./hellosdl
> TESTING: _
> jpgkubuntu-computer:~/hellosdl/debug/src$ cd ..
> jpgkubuntu-computer:~/hellosdl/debug$ src/./hellosdl
> Segmentation fault
> jpgkubuntu-computer:~/hellosdl/debug$
> 
> It wont run from any directory other than it's own.
I've had problems
> with segfaults on windows but usually those were caused
by a missing
> graphic. I know thats not the case here though. My prog
is loading one
> bitmap and it is there.
> 
> I made a helloworld prog and I could run helloworld
fine from any
> directory as well as the "Run Command" menu.
> 
>


jpgkubuntu-computer:~/hellosdl/debug$ src/./hellosdl

is the same as

jpgkubuntu-computer:~/hellosdl/debug$ src/hellosdl

the single dot is the currect dir.  ( i think its the same
on windows)
the dot is needed to tell the the shell where to start
looking for the
binary to run.

i am kinda thinking that you are attempting to open a file
in the
current dir and assuming it works.  do you have runtime
checks for
that ?

SDL_Surface *my_surface;

my_surface = SDL_LoadBMP(my_filename);

if(my_surface == NULL)
{
	fprintf(stderr, "error, failed to open image
!!");
	exit(1);
}

not sure how you can open an image from the any path.  if
you are using
a file browswer, it might not have a path set, so it can not
find the
image.  i dont know how to get that at runtime either that
would be
platform independent.  you might need to have a variable
that hard
codes it, but that is not the best solution.

matt
_______________________________________________
SDL mailing list
SDLlists.libsdl.org
h
ttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Re: SDL Linux Help
user name
2007-04-18 02:23:17
On 4/18/07, matt <mattmattehearthlink.net> wrote:
> not sure how you can open an image from the any path.

The most cross-platform way to do that is to grab the path
from
argv[0]. There are a number of other ways (ie I'm using
NSBundle with
Cocoa OS X/Cocotron Win32 to find things in
my.app/Contents/Resources).

-- 
 - $B!g(B
_______________________________________________
SDL mailing list
SDLlists.libsdl.org
h
ttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Re: SDL Linux Help
country flaguser name
Finland
2007-04-18 02:24:10
Hi,

just use getcwd() to get the current path.

Cheers,
Paulo


Quoting matt <mattmattehearthlink.net>:

> On Tue, 17 Apr 2007 17:58:00 -0500
> "Jonathan Greig" <redteam316gmail.com> wrote:
> 
> > Here is what happens in the konsole:
> > 
> > jpgkubuntu-computer:~/hellosdl/debug/src$
./hellosdl
> > TESTING: _
> > jpgkubuntu-computer:~/hellosdl/debug/src$ cd
..
> > jpgkubuntu-computer:~/hellosdl/debug$
src/./hellosdl
> > Segmentation fault
> > jpgkubuntu-computer:~/hellosdl/debug$
> > 
> > It wont run from any directory other than it's
own. I've had problems
> > with segfaults on windows but usually those were
caused by a missing
> > graphic. I know thats not the case here though. My
prog is loading one
> > bitmap and it is there.
> > 
> > I made a helloworld prog and I could run
helloworld fine from any
> > directory as well as the "Run Command"
menu.
> > 
> >
> 
> 
> jpgkubuntu-computer:~/hellosdl/debug$ src/./hellosdl
> 
> is the same as
> 
> jpgkubuntu-computer:~/hellosdl/debug$ src/hellosdl
> 
> the single dot is the currect dir.  ( i think its the
same on windows)
> the dot is needed to tell the the shell where to start
looking for the
> binary to run.
> 
> i am kinda thinking that you are attempting to open a
file in the
> current dir and assuming it works.  do you have runtime
checks for
> that ?
> 
> SDL_Surface *my_surface;
> 
> my_surface = SDL_LoadBMP(my_filename);
> 
> if(my_surface == NULL)
> {
> 	fprintf(stderr, "error, failed to open image
!!");
> 	exit(1);
> }
> 
> not sure how you can open an image from the any path. 
if you are using
> a file browswer, it might not have a path set, so it
can not find the
> image.  i dont know how to get that at runtime either
that would be
> platform independent.  you might need to have a
variable that hard
> codes it, but that is not the best solution.
> 
> matt
> _______________________________________________
> SDL mailing list
> SDLlists.libsdl.org
> h
ttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
> 




------------------------------------------------------------
----
This message was sent using IMP, the Internet Messaging
Program.
_______________________________________________
SDL mailing list
SDLlists.libsdl.org
h
ttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Re: SDL Linux Help
user name
2007-04-18 02:27:46
On 4/18/07, Paulo Pinto <pjmlpprogtools.org> wrote:
> Hi,
>
> just use getcwd() to get the current path.

It won't work, as it will fail the same way it does
currently (if the
BMP he's trying to load is not in the current directory,
it'll fail to
load).
dirname(argv[0]) is usually the way to go (this does not
remove load
checks as argv[0] can be modified, but one can count on the
fact that
barring bizarre exec()s it'll be correct for users launching
the app
in usual ways).

 - $B!g(B
_______________________________________________
SDL mailing list
SDLlists.libsdl.org
h
ttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

[1-13]

about | contact  Other archives ( Real Estate discussion Medical topics )