Developing with Kdevelop

Problems building or running the engine, queries about how to use features etc.
Post Reply
evster
Gnoblar
Posts: 13
Joined: Mon Aug 01, 2005 7:33 pm

Developing with Kdevelop

Post by evster » Mon Aug 15, 2005 12:20 am

Hi,

I have worked through most of the tutorials using just a text editor. I want to use Kdevelop now before I start into anything big. Whenever I create a project I get a whole pile of files created in the directory. Which files do I need to edit for it to compile and run properlly??
0 x

stodge
Goblin
Posts: 217
Joined: Thu Oct 24, 2002 4:12 am
Contact:

Post by stodge » Mon Aug 15, 2005 2:29 am

Use the source Luke! View the src Luke!

I think the source for any project created by KDevelop is in the src directory. Browse all those files and see what you find.
0 x
What does the debugger tell you? You *are* using a debugger, right??

User avatar
Emmeran
Goblin
Posts: 272
Joined: Wed Jun 02, 2004 11:47 am
Location: Erlangen
Contact:

Post by Emmeran » Mon Aug 15, 2005 2:31 am

I'm against all this messaround KDevelop creates so i wrote my own compiler scripts. If you want I can post them here.
0 x

User avatar
Olex
Hobgoblin
Posts: 593
Joined: Fri Apr 08, 2005 6:08 pm
Location: WA, USA

Post by Olex » Mon Aug 15, 2005 2:52 am

I use KDevelop as it is, I don't mind the files, and live just as happily. I have been developing under KDevelop for a little bit now.

About the files: generally, you want all of them that are created during first step. But if you are not sure, you can run "distclean" command and that would clean up most of the files, majority is pretty small in size.

if you give some more details about what bothers you I would be able to answer in more details.
0 x

evster
Gnoblar
Posts: 13
Joined: Mon Aug 01, 2005 7:33 pm

Post by evster » Mon Aug 15, 2005 3:03 am

Hi,

So it says I can't find Ogre.h.

How do I tell it where the paths are?
0 x

User avatar
Olex
Hobgoblin
Posts: 593
Joined: Fri Apr 08, 2005 6:08 pm
Location: WA, USA

Post by Olex » Mon Aug 15, 2005 3:34 am

"Project"->"Project Options"->"Configure Options"->Tag: "C/C++ Preprocessor flags"

Have you checked the manual for KDevelop?
http://docs.kde.org/development/en/kdevelop/kdevelop/
0 x

evster
Gnoblar
Posts: 13
Joined: Mon Aug 01, 2005 7:33 pm

Post by evster » Mon Aug 15, 2005 3:47 am

ok, thats what I figured...and so I have tried that.

Am I right in putting this in there

Code: Select all

$(shell pkg-config --cflags OGRE)
0 x

User avatar
Olex
Hobgoblin
Posts: 593
Joined: Fri Apr 08, 2005 6:08 pm
Location: WA, USA

Post by Olex » Mon Aug 15, 2005 4:02 am

evster wrote:ok, thats what I figured...and so I have tried that.

Am I right in putting this in there

Code: Select all

$(shell pkg-config --cflags OGRE)
I don't know if that works. Did it?
This is how I do it sometimes:

Code: Select all

'pkg-config --cflags OGRE'
0 x

evster
Gnoblar
Posts: 13
Joined: Mon Aug 01, 2005 7:33 pm

Post by evster » Mon Aug 15, 2005 4:16 am

I tried both

Code: Select all

'pkg-config --cflags OGRE'
and

Code: Select all

pkg-config --cflags OGRE
and I still get the compile errors.

I actually get the following errors when it tries to configure

Code: Select all

cd '/home/evan/workspace/test/debug' && CPPFLAGS="'pkg-config --cflags OGRE'" CXXFLAGS="-O0 -g3" "/home/evan/workspace/test/configure" --enable-debug=full
installing -c
checking whether build environment is sane... yes
configure: error: C++ compiler cannot create executables
See `config.log' for more details.
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for g++... g++
*** Exited with status: 77 ***
I'm not sure where the log is
0 x

sergey akifiev
Kobold
Posts: 34
Joined: Mon Feb 09, 2004 7:56 am
Contact:

Post by sergey akifiev » Mon Aug 15, 2005 4:22 am

you should put this (pkg-config --cflags OGRE) in backquotes. like this:

Code: Select all

`pkg-config --cflags OGRE`
also try this command in shell to see if it produces any usefull output.
0 x

User avatar
Olex
Hobgoblin
Posts: 593
Joined: Fri Apr 08, 2005 6:08 pm
Location: WA, USA

Post by Olex » Mon Aug 15, 2005 4:25 am

Also, then configure fails, check /proj_name/debug/config.log , (or similar directory structure).
0 x

evster
Gnoblar
Posts: 13
Joined: Mon Aug 01, 2005 7:33 pm

Post by evster » Mon Aug 15, 2005 4:28 am

Ahh. The backquotes are what got me!

Thanks!
Evan
0 x

evster
Gnoblar
Posts: 13
Joined: Mon Aug 01, 2005 7:33 pm

Post by evster » Mon Aug 15, 2005 2:29 pm

Emmeran...

I am curious to see what your scripts are. I'm guessing they are much simpler than the default Kdevlop ones.
0 x

User avatar
Emmeran
Goblin
Posts: 272
Joined: Wed Jun 02, 2004 11:47 am
Location: Erlangen
Contact:

Post by Emmeran » Mon Aug 15, 2005 7:16 pm

maybe, I didn't use them for a while because of problems with my radeon card on linux, what caused me to change to windows again for a while till the drivers get better. I'm not sure if they simple to port, but lets have a look:

it's based on php. you need this 2 files in your projects root directory:
http://emmeran.corvusmedia.de/linuxbuild.rar

and then you have one yourProject.PROJECT file for each project:

for example I had a little lib with tools. the project is called Tools:
Tools.PROJECT:

Code: Select all

<?
$NAME = "libTools";
$Project[$NAME] = Array(
	"WorkingDir" => "Build",
	"ShortDesc" => "Network and Logging tools",
	"Description" => "%(c) 2005 by CORVUS MEDIA",
    
	"Output" => Array(
		"Filename" => "libTools.so", 
		"Path" => "/usr/lib",
		"SU" => true,
	),
	
	"Compiler" => Array(
		"Includes" => Array(
			"Tools/include",
		),
	
		"Packages" => Array(
			"OGRE",
		),
	    
		"Flags" => "-g -O2",
	),
	
	"Linker" => Array(
		"Libraries" => Array(
		),
	
		"LibPaths" => Array(
		),
	
		"Packages" => Array(
			"OGRE",
		),
	    
		"Flags" => "-g -O2 -shared ",
	),
    
	"SourceDirs" => Array(
		"Tools/src",
	),
    
	"AdditionalSourceFiles" => Array(
	),
);
?>
here a little explanation:
$NAME is the variable that stores the name of your project. you may never give two projects in one directory same names!
WorkingDir is the dir in which the objects will be stored
ShortDesc is a little description (may be ignored)
Description is a longer description (may be ignored)
Output:
- Filename is the filename of the projects executable/libary which you want to make
- Path is the path where this should be stored
- SU sets, if the program should change in superuser mode before copying the file to it's destination

Compiler:
- Includes is a list of files in which the include files are stored; you do not need to add default include pathes here (like /usr/include)
- Packages is a list of pkgs you need (for pkg-config)
- Flags are additional compiler flags if you want to set some

Linker:
- Libraries is a list of special libs you want to link to
- LibPaths sets additional pathes where the linker should search for libs
- Packages: see Compiler: Packages
- Flags: see Compiler: Flags

SourceDirs is a list of directories in which the compiler will compile every *.cpp file
AdditionalSourceFiles is a list of additional single files the compiler should compile




You use the tool this way (here an example for my "Tools" project):

Code: Select all

~# cd /game/libTools
/game/libTools# php build.php config Tools
/game/libTools# php build.php build Tools 
for more info try this:

Code: Select all

/game/libTools# php build.php help
/game/libTools# php build.php info
with the following command you can delete all objects file - it does NOT delete the executable/lib:

Code: Select all

/game/libTools# php build.php clean Tools
remember to replace Tools with the name of your project!

I hope it works, good luck,
Emmeran
Last edited by Emmeran on Mon Aug 15, 2005 7:18 pm, edited 1 time in total.
0 x

User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
Contact:

Post by jacmoe » Mon Aug 15, 2005 7:17 pm

Wiki, wiki, wik.. ? :)
0 x
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.

User avatar
Emmeran
Goblin
Posts: 272
Joined: Wed Jun 02, 2004 11:47 am
Location: Erlangen
Contact:

Post by Emmeran » Mon Aug 15, 2005 8:31 pm

***WIKIED***

i've a problem with wiki... in "How to use" after the <pre> section it doesn't recognize my line breaks...
maybe someone could correct that and my bad english :roll:
0 x

Post Reply