Anjuta and SDL

Hi people,

does anyone use Anjuta (GNOME ide) for developing with SDL ??

I don’t know how to add the SDL libs to the project…I’ve coded before only
with MSVC… so any help would be great!

Bye,
Alex

Yes, I do. But currently Anjuta’s Makefile generator is fugly, it generates
makefiles with undefined variables that make barfs about repeatedly, and there
is no option currently to control what options get passed to Make (like the
option to warn about undefined variables in the makefile)…

Basically, if you copy the sdl.m4 file from the SDL sources or your local system
to acinclude.m4 in your base project directory (not the src/ directory it
creates under your project directory), and then paste the following into the
project configuration->configuration scripts->library checks under the project
menu:

dnl Check for SDL
SDL_VERSION=1.2.0
AM_PATH_SDL($SDL_VERSION,
:,
AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
)
CFLAGS="$CFLAGS $SDL_CFLAGS"
LIBS="$LIBS $SDL_LIBS"

That should do it, however, the catch is you have to use the build/build all
options in anjuta. You may have to do a configuration or something from the
project menu after you make these changes, but this is what works for me at
home…

-EvilTypeGuyOn Wed, Nov 07, 2001 at 10:15:44PM +0100, Alexander Bierbrauer wrote:

Hi people,

does anyone use Anjuta (GNOME ide) for developing with SDL ??

I don’t know how to add the SDL libs to the project…I’ve coded before only
with MSVC… so any help would be great!

Hi,

I’ve copied the sdl.m4 to acinclude.m4…everything fine so far…
I’ve also added your script to “Library Checks…” but I’ve got the
following error in the script:
…configure line 3530: syntax error near unexpected token ‘;}’
./configure line 3530: : ‘echo “$as_me:error: ***SDL version $SDL_VERSION not
found!”>&2;)’

…does this mean that the script is incorrect or I don’t have SDL ??
I’ve got SDL 1.2.2 and I can compile the programm via the console with
g++ main.cpp blablabla…

…some more hints??

Or does anyone have a solution for kdevelop??
(…here’s the problem that it doesn’t create a makefile for C/C++ Terminal
projects…even after “build -> configure”…)

Bye,
Alex

Anybody know how can I create a SDL project in Anjuta?
tnx

You create a command line project and a Makefile. Then all you have to
do is code.

I’ve attached my makefile, hand crafted before the project got imported
into Anjuta. I found that this was the only sticky point.

David Bean

-------------- next part --------------
A non-text attachment was scrubbed…
Name: Makefile
Type: text/x-makefile
Size: 1371 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20031126/d86a0a5e/attachment.binOn Wed, 2003-11-26 at 23:24, NighTiger wrote:

Anybody know how can I create a SDL project in Anjuta?
tnx

Anybody use with success Anjuta for SDL’s project?
tnx

Anybody use with success Anjuta for SDL’s project?
tnx

Hi guys, I have a little problem here, I hope you can help me find the
solution.

I’m making a game on SDL/Linux, all my code is on C and I compile it
with gcc, now I need to control an external device, the developers of
the external device give me some libraries on an API to control it but
the API is on C++, I can’t add the include to my project, i wont
compile.

Now I’m trying to figure out how to these to systems to work together,
can any one give me ideas? I appreciate all of it.

Thx.

You’re in luck, because every ansi C program is a legal ansi C++ program, so
you can compile your C code with g++.
Have fun!
Jason.> ----- Original Message -----

From: sdl-admin@libsdl.org [mailto:sdl-admin at libsdl.org]On Behalf Of
Jorge L.Martin C.
Sent: Monday, December 01, 2003 8:19 AM
To: sdl at libsdl.org
Subject: [SDL] SDL C++

Hi guys, I have a little problem here, I hope you can help me find the
solution.

I’m making a game on SDL/Linux, all my code is on C and I compile it
with gcc, now I need to control an external device, the developers of
the external device give me some libraries on an API to control it but
the API is on C++, I can’t add the include to my project, i wont
compile.

Now I’m trying to figure out how to these to systems to work together,
can any one give me ideas? I appreciate all of it.

Thx.


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Jorge L.Martin C. wrote:

I’m making a game on SDL/Linux, all my code is on C and I compile it
with gcc, now I need to control an external device, the developers of
the external device give me some libraries on an API to control it but
the API is on C++, I can’t add the include to my project, i wont
compile.

What exactly do you mean by “i wont compile”. Do you get some errors?
Can you post here?

Do those libraries have C++ interface (.h files or something)?

Now I’m trying to figure out how to these to systems to work together,
can any one give me ideas? I appreciate all of it.

There are mutiple solutions, you can:

  1. rewrite your game to use c++ (shouldn’t be much work)
  2. make c++ layer which would export all “their” stuff as c functions to
    you, and just call those c functions from your game.
  3. …I guess others will jump in here.–
    Milan Babuskov
    http://njam.sourceforge.net

You’re in luck, because every ansi C program is a legal ansi C++ program, so
you can compile your C code with g++.

As was recently pointed out to me the default language compiled by gcc
is not strictly ansi C. To get that you have to compile with -ansi
-pedantic to enforce ansi C semantics. The result is that unless you are
very careful your “C” code is not ansi C and is not fully compatible
with C++.

My suggestion is that you convert to C++. It won’t take long.

	Bob PendletonOn Mon, 2003-12-01 at 10:56, Jason Clark wrote:

Have fun!
Jason.

-----Original Message-----
From: sdl-admin at libsdl.org [mailto:sdl-admin at libsdl.org]On Behalf Of
Jorge L.Martin C.
Sent: Monday, December 01, 2003 8:19 AM
To: sdl at libsdl.org
Subject: [SDL] SDL C++

Hi guys, I have a little problem here, I hope you can help me find the
solution.

I’m making a game on SDL/Linux, all my code is on C and I compile it
with gcc, now I need to control an external device, the developers of
the external device give me some libraries on an API to control it but
the API is on C++, I can’t add the include to my project, i wont
compile.

Now I’m trying to figure out how to these to systems to work together,
can any one give me ideas? I appreciate all of it.

Thx.


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

±--------------------------------------+

Bob Pendleton wrote:

You’re in luck, because every ansi C program is a legal ansi C++
program, so you can compile your C code with g++.

As was recently pointed out to me the default language compiled by gcc
is not strictly ansi C. To get that you have to compile with -ansi
-pedantic to enforce ansi C semantics. The result is that unless you
are very careful your “C” code is not ansi C and is not fully
compatible with C++.

but gcc is not THAT far away from ansi, IMHO. also i think, if it first
compiled it as C it should also compile it as C++.

My suggestion is that you convert to C++. It won’t take long.

or you just declare your function prototypes as extern “C”. and compile
everything with g++. do something like:

#ifdef __cplusplus
extern “C” {
#endif

// your c function declarations here

#idef __cplusplus
}
#endif

in your C header files.

best regards …
clemens> On Mon, 2003-12-01 at 10:56, Jason Clark wrote:

for a newbie who doesnt know what extern is and differences in function call
types and any of this other stuff, id say your best bet would be to simply
switch from gcc to g++.

there might be a couple warnings or possibly an error or 2 but they should
be easy to resolve (:

seems to me thats the easiest and most straight forward solution> ----- Original Message -----

From: clemens@thf.ath.cx (Clemens Kirchgatterer)
To:
Sent: Monday, December 01, 2003 11:04 AM
Subject: Re: [SDL] SDL C++

Bob Pendleton wrote:

On Mon, 2003-12-01 at 10:56, Jason Clark wrote:

You’re in luck, because every ansi C program is a legal ansi C++
program, so you can compile your C code with g++.

As was recently pointed out to me the default language compiled by gcc
is not strictly ansi C. To get that you have to compile with -ansi
-pedantic to enforce ansi C semantics. The result is that unless you
are very careful your “C” code is not ansi C and is not fully
compatible with C++.

but gcc is not THAT far away from ansi, IMHO. also i think, if it first
compiled it as C it should also compile it as C++.

My suggestion is that you convert to C++. It won’t take long.

or you just declare your function prototypes as extern “C”. and compile
everything with g++. do something like:

#ifdef __cplusplus
extern “C” {
#endif

// your c function declarations here

#idef __cplusplus
}
#endif

in your C header files.

best regards …
clemens


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

NighTiger wrote:

Anybody use with success Anjuta for SDL’s project?
tnx


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Yes. Do you have any problem?

Anybody use with success Anjuta for SDL’s project?
tnx

Yes i do, but i disabled every autogenerating for config files and
makefiles in anjuta. And it is working fine.

bye bye
SteffenOn Mon, 01 Dec 2003 15:22:45 +0100 “NighTiger” wrote:

Steffen Pohle (@Steffen_Pohle)| _ x
http://stpohle.bei.t-online.de | /#/ BomberClone - The Clone of
JabberID: stpohle at amessage.de ||###| DynaBlaster and Bomberman
ICQ: 370965 Yahoo: stpohle | #/ http://www.bomberclone.de
MSN: stpohle at hotmail.com |

Hi again guys, I’m trying to change my code from C to C++, what I do is
change my cc compiler to g++ then clear all errors and warnings, no
problem here, but now I have a lot of strange errors like this

“gui.o(.bss+0x20):In function ‘loadData()’:”
"…/gui.cpp:23:multiple definition of ‘ScoreV’"

The strange part here is that the line 23 don’t even use the var ScoreV,
in some cases the refered variable isn’t present on the file.

I’m trying to find the problem, I guess it’s an link problem, but I
don’t know how to solve it.

Any ideas?

Thx.

Pd. Attached is a copy of my Makefile, I think the problem is in the way
I’m copiling, appreciate your help.On Mon, 2003-12-01 at 14:21, Alan Wolfe wrote:

for a newbie who doesnt know what extern is and differences in function call
types and any of this other stuff, id say your best bet would be to simply
switch from gcc to g++.

there might be a couple warnings or possibly an error or 2 but they should
be easy to resolve (:

seems to me thats the easiest and most straight forward solution

----- Original Message -----
From: “Clemens Kirchgatterer”
To:
Sent: Monday, December 01, 2003 11:04 AM
Subject: Re: [SDL] SDL C++

Bob Pendleton wrote:

On Mon, 2003-12-01 at 10:56, Jason Clark wrote:

You’re in luck, because every ansi C program is a legal ansi C++
program, so you can compile your C code with g++.

As was recently pointed out to me the default language compiled by gcc
is not strictly ansi C. To get that you have to compile with -ansi
-pedantic to enforce ansi C semantics. The result is that unless you
are very careful your “C” code is not ansi C and is not fully
compatible with C++.

but gcc is not THAT far away from ansi, IMHO. also i think, if it first
compiled it as C it should also compile it as C++.

My suggestion is that you convert to C++. It won’t take long.

or you just declare your function prototypes as extern “C”. and compile
everything with g++. do something like:

#ifdef __cplusplus
extern “C” {
#endif

// your c function declarations here

#idef __cplusplus
}
#endif

in your C header files.

best regards …
clemens


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl
-------------- next part --------------
A non-text attachment was scrubbed…
Name: Makefile
Type: text/x-makefile
Size: 656 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20031202/244bc3cd/attachment.bin

Sorry if you receive this message twice, I’m having problems with my
mail system…

Hi again guys, I’m trying to change my code from C to C++, what I do is
change my cc compiler to g++ then clear all errors and warnings, no
problem here, but now I have a lot of strange errors like this

“gui.o(.bss+0x20):In function ‘loadData()’:”
"…/gui.cpp:23:multiple definition of ‘ScoreV’"

The strange part here is that the line 23 don’t even use the var ScoreV,
in some cases the refered variable isn’t present on the file.

I’m trying to find the problem, I guess it’s an link problem, but I
don’t know how to solve it.

Any ideas?

Thx.

Pd. Attached is a copy of my Makefile, I think the problem is in the way
I’m copiling, appreciate your help.> On Mon, 2003-12-01 at 14:21, Alan Wolfe wrote:

for a newbie who doesnt know what extern is and differences in function call
types and any of this other stuff, id say your best bet would be to simply
switch from gcc to g++.

there might be a couple warnings or possibly an error or 2 but they should
be easy to resolve (:

seems to me thats the easiest and most straight forward solution

----- Original Message -----
From: “Clemens Kirchgatterer”
To:
Sent: Monday, December 01, 2003 11:04 AM
Subject: Re: [SDL] SDL C++

Bob Pendleton wrote:

On Mon, 2003-12-01 at 10:56, Jason Clark wrote:

You’re in luck, because every ansi C program is a legal ansi C++
program, so you can compile your C code with g++.

As was recently pointed out to me the default language compiled by gcc
is not strictly ansi C. To get that you have to compile with -ansi
-pedantic to enforce ansi C semantics. The result is that unless you
are very careful your “C” code is not ansi C and is not fully
compatible with C++.

but gcc is not THAT far away from ansi, IMHO. also i think, if it first
compiled it as C it should also compile it as C++.

My suggestion is that you convert to C++. It won’t take long.

or you just declare your function prototypes as extern “C”. and compile
everything with g++. do something like:

#ifdef __cplusplus
extern “C” {
#endif

// your c function declarations here

#idef __cplusplus
}
#endif

in your C header files.

best regards …
clemens


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl
-------------- next part --------------
A non-text attachment was scrubbed…
Name: Makefile
Type: text/x-makefile
Size: 656 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20031202/78eaa7aa/attachment.bin

I’m guessing gui.cpp:23 is actually an #include (because it’s near the
top of the file).

Be sure that you surround that included header with something like

// gui.cpp
// does something interesting

#include something useful

#ifndef GUI_H
#define GUI_H

some code here

#endif

The problem is that multiple source files are including the same
header, so whatever is in that header gets defined multiple times, each
in a different object (.o) file.

When all the object files are linked together, more than one defines
loadData(), and the linker has a fit.

Just add those #ifndef and #define with some unique value, so the
contents of that will only ever be loaded once.

Richard SchreyerOn Dec 2, 2003, at 10:11 AM, Jorge L.Martin C. wrote:

Sorry if you receive this message twice, I’m having problems with my
mail system…

Hi again guys, I’m trying to change my code from C to C++, what I do is
change my cc compiler to g++ then clear all errors and warnings, no
problem here, but now I have a lot of strange errors like this

“gui.o(.bss+0x20):In function ‘loadData()’:”
"…/gui.cpp:23:multiple definition of ‘ScoreV’"

The strange part here is that the line 23 don’t even use the var
ScoreV,
in some cases the refered variable isn’t present on the file.

I’m trying to find the problem, I guess it’s an link problem, but I
don’t know how to solve it.

Any ideas?

Thx.

Pd. Attached is a copy of my Makefile, I think the problem is in the
way
I’m copiling, appreciate your help.

That’s the problem, I already have #ifndef

#ifndef DB_H
#define DB_H



#endifOn Wed, 2003-12-03 at 01:19, Richard Schreyer wrote:

I’m guessing gui.cpp:23 is actually an #include (because it’s near the
top of the file).

Be sure that you surround that included header with something like

// gui.cpp
// does something interesting

#include something useful

#ifndef GUI_H
#define GUI_H

some code here

#endif

The problem is that multiple source files are including the same
header, so whatever is in that header gets defined multiple times, each
in a different object (.o) file.

When all the object files are linked together, more than one defines
loadData(), and the linker has a fit.

Just add those #ifndef and #define with some unique value, so the
contents of that will only ever be loaded once.

Richard Schreyer

On Dec 2, 2003, at 10:11 AM, Jorge L.Martin C. wrote:

Sorry if you receive this message twice, I’m having problems with my
mail system…

Hi again guys, I’m trying to change my code from C to C++, what I do is
change my cc compiler to g++ then clear all errors and warnings, no
problem here, but now I have a lot of strange errors like this

“gui.o(.bss+0x20):In function ‘loadData()’:”
"…/gui.cpp:23:multiple definition of ‘ScoreV’"

The strange part here is that the line 23 don’t even use the var
ScoreV,
in some cases the refered variable isn’t present on the file.

I’m trying to find the problem, I guess it’s an link problem, but I
don’t know how to solve it.

Any ideas?

Thx.

Pd. Attached is a copy of my Makefile, I think the problem is in the
way
I’m copiling, appreciate your help.


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Everything in the Makefile looks good (just one odd thing: CFLAGS has
two -ggdb’s in it), so it must be some weird thing with the code or
compiler.
First, what compiler/OS are you using (and if it’s a multi-target compiler
[gcc/g++], what system are you building for)?
Second, if you know it’s not the compiler, any chance you’re willing to post
the code, so we can help pin it down? (Remember: code errors are least
obvious to the person who wrote it)

  • Silicon> ----- Original Message -----

From: explorer@cwp.net.pa (Jorge L.Martin C.)
To:
Sent: Wednesday, December 03, 2003 11:24 AM
Subject: Re: [SDL] SDL C++

That’s the problem, I already have #ifndef

#ifndef DB_H
#define DB_H



#endif

On Wed, 2003-12-03 at 01:19, Richard Schreyer wrote:

I’m guessing gui.cpp:23 is actually an #include (because it’s near the
top of the file).

Be sure that you surround that included header with something like

// gui.cpp
// does something interesting

#include something useful

#ifndef GUI_H
#define GUI_H

some code here

#endif

The problem is that multiple source files are including the same
header, so whatever is in that header gets defined multiple times, each
in a different object (.o) file.

When all the object files are linked together, more than one defines
loadData(), and the linker has a fit.

Just add those #ifndef and #define with some unique value, so the
contents of that will only ever be loaded once.

Richard Schreyer

On Dec 2, 2003, at 10:11 AM, Jorge L.Martin C. wrote:

Sorry if you receive this message twice, I’m having problems with my
mail system…

Hi again guys, I’m trying to change my code from C to C++, what I do
is

change my cc compiler to g++ then clear all errors and warnings, no
problem here, but now I have a lot of strange errors like this

“gui.o(.bss+0x20):In function ‘loadData()’:”
"…/gui.cpp:23:multiple definition of ‘ScoreV’"

The strange part here is that the line 23 don’t even use the var
ScoreV,
in some cases the refered variable isn’t present on the file.

I’m trying to find the problem, I guess it’s an link problem, but I
don’t know how to solve it.

Any ideas?

Thx.

Pd. Attached is a copy of my Makefile, I think the problem is in the
way
I’m copiling, appreciate your help.


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.547 / Virus Database: 340 - Release Date: 12/2/2003