Need to test game development config

Hi folks,

I’ve spent the last few hours trying to get a program to run. I’m using Kdevelop and SDL, but nothing even works. One program refused to run because of a permission issue (chmod doesn’t fix it). Another program DID work after a chmod 777, but then it had an error. See below:

jeff@linux:~/projects/Sppong> ./main.c
: No such file or directory
: command not found
./main.c: line 3: Sppong:: command not found
./main.c: line 4: syntax error near unexpected token `C'
'/main.c: line 4: `Copyright (C) 2010 Issam Abdallah
jeff@linux:~/projects/Sppong> 

I’m getting sick of running programs, only to find that for one reason or another, the program doesn’t run. Can someone please send me a program which uses C or C++, along with libsdl? I’m sure that I have all the right packages installed, but I need to verify that, by running a program which is known to work.

I really need some advice on this. I’ve used Google repeatedly, but most of what I found was useless; most articles were vague guides on how to start programming in Linux. None of the articles got me anywhere.

So, in summary: I’m using OpenSUSE, Kdevelop, C++ and libsdl. Surely there is a simple program to test whether or not my configuration works? Yes I could write one myself, but I don’t want to learn C++ and all of libsdl, only to discover that my configuration is broken. I want to test my configuration first, then start a project after I know that my configuration is good. There is no point in working with potentially broken tools.

Please help.

This looks as if you want to run the source code of the c program. This will
of course fail, it is not a valid executable file (even if you make it
executable by chmod).
You need to run the resulting program from your compilation.
Can you show us the command you used to compile the program? So we can see
the name of the resulting binary.


PC: oS 11.3 64 bit | Intel Core2 Quad Q8300@2.50GHz | KDE 4.6.2 | GeForce
9600 GT | 4GB Ram
Eee PC 1201n: oS 11.4 64 bit | Intel Atom 330@1.60GHz | KDE 4.6.0 | nVidia
ION | 3GB Ram

Hi,

What is main.c? I’m assuming it’s the source code file, in which case
you need to compile the program before you try to run it.

I suggest you learn to program before you go any further, the best way
to do this is to buy a good book and work through the exercises.

On Wed, 27 Apr 2011, j mitchell wrote:

>
> Hi folks,
>
> I’ve spent the last few hours trying to get a program to run. I’m using
> Kdevelop and SDL, but nothing even works. One program refused to run
> because of a permission issue (chmod doesn’t fix it). Another program
> DID work after a chmod 777, but then it had an error. See below:
>
>
> Code:
> --------------------
> jeff@linux:~/projects/Sppong> ./main.c
> : No such file or directory
> : command not found
> ./main.c: line 3: Sppong:: command not found
> ./main.c: line 4: syntax error near unexpected token `C’

'/main.c: line 4: `Copyright (C) 2010 Issam Abdallah
> jeff@linux:~/projects/Sppong>
>
> --------------------
>
> I’m getting sick of running programs, only to find that for one reason
> or another, the program doesn’t run. Can someone please send me a
> program which uses C or C++, along with libsdl? I’m sure that I have all
> the right packages installed, but I need to verify that, by running a
> program which is known to work.
>
> I really need some advice on this. I’ve used Google repeatedly, but
> most of what I found was useless; most articles were vague guides on how
> to start programming in Linux. None of the articles got me anywhere.
>
> So, in summary: I’m using OpenSUSE, Kdevelop, C++ and libsdl. Surely
> there is a simple program to test whether or not my configuration works?
> Yes I could write one myself, but I don’t want to learn C++ and all of
> libsdl, only to discover that my configuration is broken. I want to test
> my configuration first, then start a project after I know that my
> configuration is good. There is no point in working with potentially
> broken tools.
>
> Please help.
>
>
> –
> j_mitchell
> ------------------------------------------------------------------------
> j_mitchell’s Profile: http://forums.opensuse.org/member.php?userid=52012
> View this thread: http://forums.opensuse.org/showthread.php?t=458772
>


Regards,
Barry D. Nichols

Whoops, I just made an ass of myself again. Hahaha. Yes, that was a source file I just tried executing, oh dear. Sorry but I’ve been mashing the keyboard so fast and I’m running commands without thinking it through.

@Barry Nichols: I do actually know how to do programming. I’ve gone through half a book on C just recently (I own the book), and I’ve been on and off coding for years. I don’t have much trouble learning programming per se, it’s just the setup that troubles me. Also, I don’t have a degree in this subject.

Anyway, I’ve got another program from the sdl website. I even made the executable this time :slight_smile: Here’s my terminal output:

jeff@linux:~/projects/aliens-1.0.2> ls
acinclude.m4  aliens    aliens.o    CHANGES       config.log     configure     COPYING  install-sh  Makefile.am  missing        MPWmake.sea.hqx  VisualC.zip
aclocal.m4    aliens.c  autogen.sh  config.cache  config.status  configure.in  data     Makefile    Makefile.in  mkinstalldirs  README
**jeff@linux:~/projects/aliens-1.0.2> ./aliens.o**
**bash: ./aliens.o: cannot execute binary file**
jeff@linux:~/projects/aliens-1.0.2> ls -l
total 296
-rw-r--r-- 1 jeff users  6028 Dec 22  1999 acinclude.m4
-rw-r--r-- 1 jeff users  9568 Feb 25  2000 aclocal.m4
-rwxr-xr-x 1 jeff users 36985 Apr 27 11:11 aliens
-rwxrwxrwx 1 jeff users 12867 Feb 25  2000 aliens.c
**-rwxrwxrwx 1 jeff users 31516 Apr 27 11:11 aliens.o**
-rwxr-xr-x 1 jeff users    64 Jan 20  2000 autogen.sh
-rw-r--r-- 1 jeff users   189 Feb 25  2000 CHANGES
-rw-r--r-- 1 jeff users  1305 Apr 27 11:09 config.cache
-rw-r--r-- 1 jeff users  1275 Apr 27 11:11 config.log
-rwxr-xr-x 1 jeff users  5340 Apr 27 11:11 config.status
-rwxr-xr-x 1 jeff users 56110 Feb 25  2000 configure
-rw-r--r-- 1 jeff users  1046 Feb 25  2000 configure.in
-rw-r--r-- 1 jeff users 15145 Oct  8  1999 COPYING
drwxr-xr-x 2 jeff users  4096 Jan 20  2000 data
-rwxr-xr-x 1 jeff users  5598 Dec 22  1999 install-sh
-rw-r--r-- 1 jeff users  9178 Apr 27 11:11 Makefile
-rw-r--r-- 1 jeff users   212 Feb 25  2000 Makefile.am
-rw-r--r-- 1 jeff users  8985 Feb 25  2000 Makefile.in
-rwxr-xr-x 1 jeff users  6283 Dec 22  1999 missing
-rwxr-xr-x 1 jeff users   722 Dec 22  1999 mkinstalldirs
-rw-r--r-- 1 jeff users 26340 Feb 25  2000 MPWmake.sea.hqx
-rw-r--r-- 1 jeff users   354 Oct  8  1999 README
-rw-r--r-- 1 jeff users  1702 Feb 25  2000 VisualC.zip
jeff@linux:~/projects/aliens-1.0.2> 

Still doesn’t like me. I bet my left-one that it’s really obvious. Funny thing is, I checked the other thread and made my root partition exec, for executable. Yet I can’t execute a program.

On Wed, 27 Apr 2011, j mitchell wrote:

>
> Whoops, I just made an ass of myself again. Hahaha. Yes, that was a
> source file I just tried executing, oh dear. Sorry but I’ve been mashing
> the keyboard so fast and I’m running commands without thinking it
> through.
>
> @Barry Nichols: I do actually know how to do programming. I’ve gone
> through half a book on C just recently (I own the book), and I’ve been
> on and off coding for years. I don’t have much trouble learning
> programming per se, it’s just the setup that troubles me. Also, I don’t
> have a degree in this subject.
>
> Anyway, I’ve got another program from the sdl website. I even made the
> executable this time :slight_smile: Here’s my terminal output:
>

Sorry, I just assumed because you were trying to run a source code file
that this was your first attempt at programming.

>
> Code:
> --------------------
> jeff@linux:~/projects/aliens-1.0.2> ls
> acinclude.m4 aliens aliens.o CHANGES config.log configure COPYING install-sh Makefile.am missing MPWmake.sea.hqx VisualC.zip
> aclocal.m4 aliens.c autogen.sh config.cache config.status configure.in data Makefile Makefile.in mkinstalldirs README
> JEFF@LINUX:~/PROJECTS/ALIENS-1.0.2> ./ALIENS.O
> bash: ./aliens.o: cannot execute binary file
> jeff@linux:~/projects/aliens-1.0.2> ls -l
> total 296
> -rw-r–r-- 1 jeff users 6028 Dec 22 1999 acinclude.m4
> -rw-r–r-- 1 jeff users 9568 Feb 25 2000 aclocal.m4
> -rwxr-xr-x 1 jeff users 36985 Apr 27 11:11 aliens
> -rwxrwxrwx 1 jeff users 12867 Feb 25 2000 aliens.c
> -RWXRWXRWX 1 JEFF USERS 31516 APR 27 11:11 ALIENS.O
> -rwxr-xr-x 1 jeff users 64 Jan 20 2000 autogen.sh
> -rw-r–r-- 1 jeff users 189 Feb 25 2000 CHANGES
> -rw-r–r-- 1 jeff users 1305 Apr 27 11:09 config.cache
> -rw-r–r-- 1 jeff users 1275 Apr 27 11:11 config.log
> -rwxr-xr-x 1 jeff users 5340 Apr 27 11:11 config.status
> -rwxr-xr-x 1 jeff users 56110 Feb 25 2000 configure
> -rw-r–r-- 1 jeff users 1046 Feb 25 2000 configure.in
> -rw-r–r-- 1 jeff users 15145 Oct 8 1999 COPYING
> drwxr-xr-x 2 jeff users 4096 Jan 20 2000 data
> -rwxr-xr-x 1 jeff users 5598 Dec 22 1999 install-sh
> -rw-r–r-- 1 jeff users 9178 Apr 27 11:11 Makefile
> -rw-r–r-- 1 jeff users 212 Feb 25 2000 Makefile.am
> -rw-r–r-- 1 jeff users 8985 Feb 25 2000 Makefile.in
> -rwxr-xr-x 1 jeff users 6283 Dec 22 1999 missing
> -rwxr-xr-x 1 jeff users 722 Dec 22 1999 mkinstalldirs
> -rw-r–r-- 1 jeff users 26340 Feb 25 2000 MPWmake.sea.hqx
> -rw-r–r-- 1 jeff users 354 Oct 8 1999 README
> -rw-r–r-- 1 jeff users 1702 Feb 25 2000 VisualC.zip
> jeff@linux:~/projects/aliens-1.0.2>
>
> --------------------
>
> Still doesn’t like me. I bet my left-one that it’s really obvious.
> Funny thing is, I checked the other thread and made my root partition
> exec, for executable. Yet I can’t execute a program.
>
>
> –
> j_mitchell
> ------------------------------------------------------------------------
> j_mitchell’s Profile: http://forums.opensuse.org/member.php?userid=52012
> View this thread: http://forums.opensuse.org/showthread.php?t=458772
>

Just a guess, have you tried running the file called aliens?

…/aliens


Regards,
Barry D. Nichols

Ahhhhh, it lives! In C, I thought that the “.o file” was the executable (at least by convention). I don’t know why** ./aliens** was the executable file, but thanks anyway. “Aliens” uses SDL, so many of the libs are clearly working.

Today I’ll be borrowing a C++ book off a friend, and then I’m going to take a stab at game development. This could be very positive.

Hi,

On Wed, 27 Apr 2011, j mitchell wrote:

>
> Barry_Nichols;2330566 Wrote:
>>
>> Just a guess, have you tried running the file called aliens?
>>
>> …/aliens
>>
> Ahhhhh, it lives! In C, I thought that the “.o file” was the
> executable (at least by convention). I don’t know why* ./aliens* was the
> executable file, but thanks anyway. “Aliens” uses SDL, so many of the
> libs are clearly working.

Usually the .o file is the compiled object file of one source code file,
but this still has to be linked with other .o files and library files to
produce the executable program.

>
> Today I’ll be borrowing a C++ book off a friend, and then I’m going to
> take a stab at game development. This could be very positive.
>
>
> –
> j_mitchell
> ------------------------------------------------------------------------
> j_mitchell’s Profile: http://forums.opensuse.org/member.php?userid=52012
> View this thread: http://forums.opensuse.org/showthread.php?t=458772
>

Glad you got it working, have fun.


Regards,
Barry D. Nichols