| Basics | Objects | Types | Hello World |
To get a first impression, here is a simple project written in ACDK.
The Project acdk_boot is provided to demonstrate a basic ACDK project
with a modules DLL/SO, an executable and a testing unit.
Please refer also to:
The sample is a little bit outdated.
For sample code, please refer to the acdk_boot package.
For our first project, we need to edit the Project.lsp file. In this example, we will call it HelloACDK.
- First, create a new workspace directory with:
$> mkdir /path/to/My/acdk_workspace
- Then, create a project directory inside your ACDK workspace.
- For source files, make a directory structure like
and put your source files in the directory "Project/src/Project."
- Create the config file "Project.lsp" and edit it in the directory "acdk_workspace/Project/src"
with your project settings.
- Create the makefiles for the gcc compiler with acdklisp or dsp files for MS VC++,
using the following commands:
The result is "Project.target", which is the makefile for unix systems
$>acdklisp Project.lsp $target #target is the compiler you use
$>acdklisp Project.lsp linux #target is linux
$>acdklisp Project.lsp dsp #target is MS VC++
and a projectfile on Win32 platforms.
We create a directory called "HelloACDK", which is the projectdirectory. Then, we need a source directory
"src". We now copy the file "HelloWorld.lsp" from acdk_boot in the source directory and edit it.
open "HelloACDK.lsp" and edit this file. First, you have to change the projectname in line 28.
$>cp ACDK_HOME/acdk_boot/src/HelloWorld.lsp /path/to/My/acdk_workspace/HelloACDK/src/HelloACDK.lsp
28: (setg acdkmake-project-name "HelloWorld") ;;; replace this name
In line 33, you are able to change the binary directory for the compiler and default, is the path to
28: (setg acdkmake-project-name "HelloACDK") ;;; replace this name
the acdk binary directory "ACDK_HOME/bin". Change line 33 from
33: (setg acdkmake-project-exec-dir (s+ acdk-home "/bin" (if ...
In line 62, we change the path to source files for our project.
33: (setg acdkmake-project-exec-dir (s+ "My/acdk_workspace/bin" (if ...
Currently, we have the file HelloACDK.cpp. We now start acdklisp using the following command.
When acdklisp is completed, we find the file "HelloACDK.linux" in the "src" directory, which
$>acdklisp HelloACDK.lsp linux #target is linux
$>acdklisp HelloACDK.lsp dsp #target is MS VC++
is the makefile for linux and "HelloACDK.dsp," the projectfile for VC++. We are now able to compile
project under linux with
and under Windows with MS VC++. You find binary files in the directory, which
$>make -f HelloACDK.linux
you have entered into the file of "HelloACDK.lsp" in line 33.
You can find the source file in the acdk_tutorial directory.
// including ACDK-declarations
// include needed ACDK-Classes
// import namespace
using namespace acdk::lang;
: extends ::acdk::lang::Object
static int acdkmain(IN(RStringArray) args);
System::out->println("Hello First User ;-)");
RHelloACDK hello = new HelloACDK();
int main(int argc, char* argv, char** envptr)
// enter acdk's world
return acdk::lang::System::main(HelloACDK::acdkmain, argc, argv, envptr);