Crystal Space
Welcome, Guest. Please login or register.
October 23, 2014, 09:36:38 pm

Login with username, password and session length
Search:     Advanced search
9010 Posts in 2044 Topics by 8800 Members
Latest Member: Xxbobo
* Home Help Search Login Register
+  Crystal Space
|-+  Crystal Space Development
| |-+  Support
| | |-+  Build simple application
« previous next »
Pages: [1] Print
Author Topic: Build simple application  (Read 2925 times)
ibob
Newbie
*
Posts: 7


View Profile
« on: March 06, 2006, 08:08:26 pm »

Hello

I have WinXP and using MinGW/Msys. I have built CS with jam and the demos work fine.
I am trying to build the a simple application, like the one in 4.3.1.1 Simple Header File. I follow the steps described in 4.21.1 Creating an External Crystal Space Application in order to build it. For the CRYSTAL environment variable I use the dir where I have built in CS .

Lets say that I have simple.h, simple.cpp.  I run createproject.sh. If I give my project the title 'simple' a directory named 'simple' is going to be created. Could you give me some directions on how to continue from there?
For example, In /src there the generated files simple.h, main.cpp, appsimple.cpp, appsimple.h. I guess my simple.h should replace the generated simple.h and my simple.cpp should be divided in the main.cpp and appsimple.cpp.
Moreover how am I actually going to build this jam project?

I have asked about this in the irc channel too, a couple of days ago but I couldn't stay in for long Sad

Thanks in advance
Logged
bernardofd
Jr. Member
**
Posts: 74


59948732 bernardofd@click21.com.br
View Profile WWW
« Reply #1 on: March 06, 2006, 08:17:25 pm »

Well;

If your simple.cpp have the main function implemented, just erase all files generated by createproject.sh and put your source file in the place, and type jam in the previous directory. (Don't forget to run ./configure before...).

If not, edit the main.cpp file to look like something like this:
Code:
#include "simple.h"
#include <csutil/sysfunc.h> // Provides csPrintf()

CS_IMPLEMENT_APPLICATION

int main(int argc, char** argv)
{
csPrintf ("Simple App\n");

return csApplicationRunner<Simple>::Run (argc, argv);
}

Note: You may change some names to fit your code's.

Compile it all and test... This shall work...

Regards
Logged

__________________________
Bernardo Figuerêdo Domingues
Computer Science - UFMG - Brazil
ibob
Newbie
*
Posts: 7


View Profile
« Reply #2 on: March 07, 2006, 12:23:04 pm »


If your simple.cpp have the main function implemented, just erase all files generated by createproject.sh and put your source file in the place, and type jam in the previous directory. (Don't forget to run ./configure before...).


well that's one of my problems. I can't find a configure file to excecute it, anywhere in the directory generated from createproject.sh . Should I create it myself?

And what about jam itself? I guess I should run jam from /simple not from /simple/src

Quote
Compile it all and test... This shall work...

Thats' what I am trying to find out Smiley how to compile the project.

I have compliled myself other programs on Win and linux in the past, so I have a bit of experience but...
Logged
bernardofd
Jr. Member
**
Posts: 74


59948732 bernardofd@click21.com.br
View Profile WWW
« Reply #3 on: March 07, 2006, 04:12:49 pm »


well that's one of my problems. I can't find a configure file to excecute it, anywhere in the directory generated from createproject.sh . Should I create it myself?


Did you run the createproject.sh script right? It creates a directory with all base files for a project build, including the configure script. This is my directory created by createproject.sh:


bfd@halflife:~/csApp/erd/erd-v0.01$ ls
AppErd.cfg  config.h.in    configure     Jamfile.in  map  msvc    src       vfs.cfg
autogen.sh  config-msvc.h  configure.ac  Jamrules    mk   README 

Note: Erd is my project name supplied in the script's query "Short Project Name".

And what about jam itself? I guess I should run jam from /simple not from /simple/src

Yes... After configuring the build, just type jam in the top-level dir of your project.

Regards...
« Last Edit: March 07, 2006, 04:21:01 pm by bernardofd » Logged

__________________________
Bernardo Figuerêdo Domingues
Computer Science - UFMG - Brazil
ibob
Newbie
*
Posts: 7


View Profile
« Reply #4 on: March 07, 2006, 08:59:57 pm »

Quote
bfd@halflife:~/csApp/erd/erd-v0.01$ ls
AppErd.cfg  config.h.in    configure     Jamfile.in  map  msvc    src       vfs.cfg
autogen.sh  config-msvc.h  configure.ac  Jamrules    mk   README

well... there seems to be aproblem there as I only have:

v@V-1 /c/cs/test/simple2
$ ls
Jamfile.in  README      config-msvc.h  mk    src
Jamrules    autogen.sh  configure.ac   msvc

/test is my directory for my CS test and simple2 the short name of the app.

I run the script again and here is what I got:

---------------------------------------------------------------------------------------------------------

v@V-1 /c/cs/test
$ CRYSTAL=/c/cs/cs

v@V-1 /c/cs/test
$ export CRYSTAL

v@V-1 /c/cs/test
$ echo $CRYSTAL
/c/cs/cs

v@V-1 /c/cs/test
$ /c/cs/cs/scripts/jamtemplate/createproject.sh
Crystal Space External Project Template Creation

This script will generate a basic Crystal Space project for you, complete with
configuration (Autoconf) and build system (Jam).  The project will be created
in a subdirectory of the current directory.  You can abort the script at any
time by typing Ctrl-C.

**** Project
Choose a project name.  We need a short form of the name for use in directory
and file names.  The short name should be lowercase (though not strictly
required) and must not contain any special characters or spaces.  We also need
a long name for use in help messages and the README file.  For example, if you
project is called "Space Fighters - Revenge for Ducky", then you may want to
choose a short name "spacefighters", and a long name "Space Fighters - Revenge
for Ducky".  You may also provide an address for the project's home page.
Please specify a complete URI.  For example: http://www.spacefighter.org/

Short name: simple3
Long name: the 3rd simple
Version: .1
Home page URI: www

**** Contact
The information about the author is mentioned in the README file and in the
configuration script so that people see a support address when they invoke
"./configure --help".  When asked for the copyright information, type the full
copyright notice as you wish it to appear in the generated files. For instance:
Copyright (C)2005 by Duffer McFluffer

Author: vag
Email: vag@vag.com
Copyright: no

**** License
The meta-information which describes a plugin module can be embedded directly
into the plugin itself on some platforms or laid down alongside the plugin in a
separate *.csplugin file. On Unix, embedding is accomplished with the
GPL-licensed libbfd library, which can be used legally with projects carrying a
GPL or GPL-compatible license. If your project is not compatible with GPL, then
embedding via libbfd should be disabled by default on Unix to prevent libbfd's
GPL license from infecting your project. Your response to this question
controls the default embedding setting on Unix (though the end-user can
override the default with the configure script's --enable-meta-info-embedding
option). If you are unsure of the answer, then respond "no".

GPL-compatible? [no] no

**** Dependencies
The Crystal Entity Layer (CEL) is a set of classes and modules which layer
game-oriented facilities atop Crystal Space. (http://cel.crystalspace3d.org/)
The Autoconf configuration script and Jam build system can be set up to work
with CEL if your project will utilize this SDK.

Utilize CEL? [no] no

*Creating project: simple3
*Running: autoheader autoconf
./autogen.sh: autoheader: command not found

*Generation successful.


You should now examine the generated project and customize it as needed.  In
particular, the files README, appsimple3.cpp, and appsimple3.h will
require modification. Also consult "./configure --help" and "jam help" (after
configuring the project) to learn about your project's build-system
capabilities.

Have fun with Crystal Space.


---------------------------------------------------------------------------------------------------------


I hadn't notice the error as it said generation succesfull. There seems to be missing autoheader (of Autoconf ?).

I think (I did it some time ago and I found this from the exe files I have) I have MinGW-3.1.0-1 and MSYS-1.0.10
When I do
$ gcc -v
Reading specs from c:/cs/mingw/bin/../lib/gcc-lib/mingw32/3.2.3/specs
Configured with: ../gcc/configure --with-gcc --with-gnu-ld --with-gnu-as --host=mingw32 --target=mingw32 --prefix=/mingw --enable-threads --disable-nls --enable-languages=c++,f77,objc --disable-win32-registry --disable-shared --enable-sjlj-exceptions
Thread model: win32
gcc version 3.2.3 (mingw special 20030504-1)

But I don't how the above helps





Logged
jorrit
Administrator
Hero Member
*****
Posts: 1706


View Profile
« Reply #5 on: March 07, 2006, 09:13:27 pm »

You must install autoconf and automake seperatelly from the mingw site. They are not standard included.

Greetings,
Logged
ibob
Newbie
*
Posts: 7


View Profile
« Reply #6 on: March 19, 2006, 01:08:34 pm »

You must install autoconf and automake seperatelly from the mingw site. They are not standard included.

Greetings,

Sorry for my late response, had problems with my computer's hardware... I installed them with the msysDTK-xxx.exe and it worked fine. This can be added to the documentation as well.

Thanks
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 6.286 seconds with 15 queries.