Building a project using Anjuta (a fast tutorial)

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
Post Reply
asterick
Gnoblar
Posts: 1
Joined: Mon Jun 28, 2004 6:54 am

Building a project using Anjuta (a fast tutorial)

Post by asterick »

I'm simply posting this here because I've yet to find it anywhere else, this is just going to be a quick and dirty, so if anyone else wants to clean it up and make it more friendly, feel free. I'm also writting this with the build 1.2.2 in mind, your version may vary.



Step 1:
Create a new project using the opening window, or using File->New Project. This will load up the application wizard

Step 2:
Click next, then select "Generic / Terminal", next again, and fill in the fields as you see fit. Select either "C++" or "Both C and C++" as your project type, and be sure to make your project and executable target. All the remaining values are up to you.

Step 3:
After you have your base project, go to Project -> Configure Project. Select the Configuration tab. Under this sub-view, select Libraries

You should be presented with a large, empty box, simply paste this code into it:

Code: Select all

PKG_CHECK_MODULES(ogre, [OGRE >= 0.14])
AC_SUBST(ogre_CFLAGS)
AC_SUBST(ogre_LIBS)

Press 'apply' and 'ok'

Step 4:
Go to Settings -> Compiler and linker options. Select the Options tag, and enter ${ogre_CFLAGS} in Compiler Flags, and ${ogre_LIBS} in Linker Flags.

Step 5:
Go to Build -> Auto Generate . This will reconfigure autoconf to allow for ogre. If you want to use an ExampleApplication, you should simply copy ExampleApplication.h and ExampleFrameListener.h to your project directory, but I don't advise using these unless you are beginning with ogre.

Enjoy! :D
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Post by sinbad »

Very cool, thanks!
User avatar
Flandry
Gnoblar
Posts: 5
Joined: Wed Jul 21, 2004 4:22 am
Location: Boston

Post by Flandry »

This is good stuff, but kinda lost in the fora. How about a "Linux Particulars" sub forum? Or alternatively, a link from "Tutorials". I found the tutorials fairly worthless WRT starting in linux.
User avatar
bana
Greenskin
Posts: 132
Joined: Mon Aug 02, 2004 7:40 am
Location: Austin, Texas
Contact:

Post by bana »

I agree, this tutorial started me on my way quickly and painlessly. Perhaps at least stickied?
User avatar
bana
Greenskin
Posts: 132
Joined: Mon Aug 02, 2004 7:40 am
Location: Austin, Texas
Contact:

Post by bana »

Has anyone found a way to make the current Samples into Anjuta projects? I tried importing a Sample (Terrain) but it won't auto-generate.

Also, whenever I create a new project, the Project options are fine (with the three lines in the libraries tab) yet the Compiler options CFLAGS and LDFLAGS I have to add every time. Is there a way to stick this for good?
shul
Gnoblar
Posts: 24
Joined: Sat Sep 11, 2004 9:49 am

Post by shul »

edit: I got no more questions, if you have one of the below problems check out the solutions in this post as well

Hi,
Thanks for the nice set of guidelines, I've install anjuta 1.2.2 on my gentoo box, and I get this message trying to run configure (both from anjuta and the console):

Code: Select all

configure: error: Library requirements (OGRE) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.
edit: writing on gentoo:

Code: Select all

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/
Does the trick, but now I have a new problem, while trying to compile the code at http://ogre.digitalsentience.com/wiki/i ... uidetoOGRE

(I defined EXT_HASH)

I get :

Code: Select all

make[2]: Entering directory `/home/shul/Projects/OgreTry/src'
g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/local/include/OGRE   -DEXT_HASH                  -Wall   -g  -c main.cc
In file included from /usr/local/include/OGRE/OgreException.h:31,
                 from /usr/local/include/OGRE/Ogre.h:30,
                 from main.cc:2:
/usr/local/include/OGRE/OgreString.h:73: error: syntax error before `::' token
/usr/local/include/OGRE/OgreString.h:74: error: ISO C++ forbids declaration of
   `operator()' with no type
ok.. to avoid the above declare GCC_3_1 as well, also, point to the Common folder in the included samples and remove the MessageBox line (replace with printf or something)
User avatar
DWORD
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 1365
Joined: Tue Sep 07, 2004 12:43 pm
Location: Aalborg, Denmark
Contact:

Post by DWORD »

I'm sorry to ask this question here, but I can't find the answer elsewhere. So, where do I put "export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/"? I tried ~/.bashrc, ~/.bash_profile, and /etc/profile but it doesn't seem to work. It never gets defined inside anjuta running ./autogen.sh :?

edit: I'm using debian if that matters.

edit: Ok, putting it before

Code: Select all

PKG_CHECK_MODULES(ogre, [OGRE >= 0.14])
AC_SUBST(ogre_CFLAGS)
AC_SUBST(ogre_LIBS)
works. Is this the way to do it?
User avatar
SomeFusion
Gremlin
Posts: 191
Joined: Sun Dec 01, 2002 12:38 am
x 3

Post by SomeFusion »

Does Anjuta's Code Completion work well with Ogre?
User avatar
bana
Greenskin
Posts: 132
Joined: Mon Aug 02, 2004 7:40 am
Location: Austin, Texas
Contact:

Post by bana »

It seems to work alright, I've never done any work with another compiler (except vim and gedit) so I can't really say however.
A proud member of the OpenFrag Coding Team.
http://coolhands.blogspot.com/
waxor
Gnoblar
Posts: 7
Joined: Wed Mar 17, 2004 5:49 pm
Contact:

Post by waxor »

There is a complete working anjuta project available here:

http://waxor.com/page/ogre-dome.tgz

Should have everything you need to get started.

[/quote]
User avatar
Kezzer
Orc
Posts: 444
Joined: Mon Aug 16, 2004 2:19 pm
Location: Silicon Valley

Post by Kezzer »

Can we get one of these for Code::Blocks? :)
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Post by sinbad »

How about starting with the sample projects and working from there?
Ceacy
Halfling
Posts: 81
Joined: Sat Jan 29, 2005 5:47 pm
Location: Paris, France.
Contact:

Post by Ceacy »

Just a little update, for Ogre 1.0.x and CEGUI :

Step 3 :

Code: Select all

PKG_CHECK_MODULES(ogre, [OGRE >= 1.0])
AC_SUBST(ogre_CFLAGS)
AC_SUBST(ogre_LIBS) 
PKG_CHECK_MODULES(ceguiogre, [CEGUI-OGRE >= 1.0])
AC_SUBST(ceguiogre_CFLAGS)
AC_SUBST(ceguiogre_LIBS) 
PKG_CHECK_MODULES(cegui, [CEGUI >= 0.2.0])
AC_SUBST(cegui_CFLAGS)
AC_SUBST(cegui_LIBS) 
Step 4 :
Compiler flags :

Code: Select all

${ogre_CFLAGS} ${cegui_CFLAGS} ${ceguiogre_CFLAGS}
Linker flags :

Code: Select all

${ogre_LIBS} ${cegui_LIBS} ${ceguiogre_LIBS} 
Note : this is for anjuta 1.2.x (stable branch) ; I didn't find how to do the same thing with anjuta 2.0.1 : if someone has an idea ...
hecato
Halfling
Posts: 42
Joined: Thu Aug 10, 2006 12:20 pm

Hi there...

Post by hecato »

First post :D...

The "little update, for Ogre 1.0.x and CEGUI" work ok, tougth dont know what to do from there :S.



OK, the question.

Im beginning in this, also don't understand mucha about programming in Linux... like the error Im getting now...

My system: ubuntu for AMD 64, nvidia video integrated.

I have installed the nvidia-xgl, and runned xgl and xglgears and run OK.

I have downloaded all the things for anjuta to work, gcc, g++.

I have downloaded the ogre libs, and cegui libs.

I have downloaded the zip file of the anterior example ogre-dome.tgz and say "... can't open waxor ..." or some like that, that can be fixed deleting the "waxor" paths from compiler & linker settings the paths for headers and libs.



After that come the problem, I hit build and here is the output... (is a translation from spanish to english).
Compiling source folder of the project: Dome ...
make
make: *** There is no rule for build objetive `@MAINTAINER_MODE_TRUE@', required for `Makefile.in'. Stop.
Completed ... incorrectly
Elapsed time: 3 secs

Hope you know what the problem is.
irgendwo
Gnoblar
Posts: 1
Joined: Tue Nov 07, 2006 11:49 am

excellent... excellent...

Post by irgendwo »

after trying to get ogre working as I wish it to on a windows setup.... it works great when you are just using ogre... but as soon as I tried to interface the ogre stuff with other stuffs I began to run into the limitations of windows as a development platform... and they say linux has dependency hell.. hehe.... excellent excellent... very nice...

this worked perfectly thanks author :) :D
Post Reply