Crystal Space
Welcome, Guest. Please login or register.
September 02, 2014, 08:07:23 am

Login with username, password and session length
Search:     Advanced search
9009 Posts in 2043 Topics by 8374 Members
Latest Member: Donaldyokley
* Home Help Search Login Register
+  Crystal Space
|-+  Crystal Space Development
| |-+  Support
| | |-+  Newbie - Tutorial Build errors
« previous next »
Pages: [1] Print
Author Topic: Newbie - Tutorial Build errors  (Read 709 times)
edward84
Newbie
*
Posts: 2


View Profile Email
« on: October 31, 2011, 04:13:43 am »

Hi All

I'm new to crystalspace and coming back to C++ after a long stint using Java.

I am getting build errors while trying to follow This Tutorial http://www.crystalspace3d.org/docs/online/1.4/manual/Tutorial-Simple.html#0
I get stuck on the very first part on 4.2.1.1 Simple Header File.

First error was with the include path. i saw that my include was /usr/local/include/crystalspace1.4 I renamed it to crystalspace for simplicity and changed the header file to be #include <crystalspace/crystalspace.h> can you confirm this was the correct way to do this?

Next after that I run into the following errors

 Header file:

Code:
#ifndef SIMPLE_H_
#define SIMPLE_H_

#include <crystalspace/crystalspace.h>

class Simple: public csApplicationFramework, public csBaseEventHandler {
private:
csRef<iEngine> engine;
csRef<iLoader> loader;
csRef<iGraphics3D> g3d;
csRef<iKeyboardDriver> kbd;
csRef<iVirtualClock> vc;

void ProcessFrame();
void FinishFrame();

public:
Simple();
~Simple();

void OnExit();
bool OnInitialize(int argc, char* argv[]);

bool Application();

CS_EVENTHANDLER_NAMES("application.simple1");
CS_EVENTHANDLER_NIL_CONSTRAINTS //PROBLEM
};

class simple {
public:
simple();
virtual ~simple();
};
#endif /* SIMPLE_H_ */

The program is with 'CS_EVENTHANDLER_NIL_CONSTRAINTS' now i understand this is a definition but the error is

- Invalid arguments ' Candidates are: const ? *
    GenericSucc(csRef<iEventHandlerRegistry> &, csRef<iEventNameRegistry> &, ?) '

I tried looking for a solution but I could not find any, also I got the impression that this was a part of crystalspace 2.x is that correct?

Cpp file

Code:
#include "simple.h"

CS_IMPLEMENT_APPLICATION

Simple::Simple ()
{
  SetApplicationName ("CrystalSpace.Simple1");
}

Simple::~Simple ()
{
}

void Simple::ProcessFrame ()
{
}

void Simple::FinishFrame ()
{
}

bool Simple::OnInitialize(int argc, char* argv[])
{
  if (!csInitializer::RequestPlugins(GetObjectRegistry(),
    CS_REQUEST_VFS,
    CS_REQUEST_OPENGL3D,
    CS_REQUEST_ENGINE,
    CS_REQUEST_FONTSERVER,
    CS_REQUEST_IMAGELOADER,
    CS_REQUEST_LEVELLOADER,
    CS_REQUEST_REPORTER,
    CS_REQUEST_REPORTERLISTENER,
    CS_REQUEST_END))
    return ReportError("Failed to initialize plugins!");

  csBaseEventHandler::Initialize(GetObjectRegistry());
  if (!RegisterQueue(GetObjectRegistry(), csevAllEvents(GetObjectRegistry())))
    return ReportError("Failed to set up event handler!");

  return true;
}

void Simple::OnExit()
{
}

bool Simple::Application()
{
  if (!OpenApplication(GetObjectRegistry()))
    return ReportError("Error opening system!");

  g3d = csQueryRegistry<iGraphics3D> (GetObjectRegistry());
  if (!g3d) return ReportError("Failed to locate 3D renderer!");

  engine = csQueryRegistry<iEngine> (GetObjectRegistry());
  if (!engine) return ReportError("Failed to locate 3D engine!");

  vc = csQueryRegistry<iVirtualClock> (GetObjectRegistry());
  if (!vc) return ReportError("Failed to locate Virtual Clock!");

  kbd = csQueryRegistry<iKeyboardDriver> (GetObjectRegistry());
  if (!kbd) return ReportError("Failed to locate Keyboard Driver!");

  loader = csQueryRegistry<iLoader> (GetObjectRegistry());
  if (!loader) return ReportError("Failed to locate Loader!");

  Run();

  return true;
}

/*---------------*
 * Main function
 *---------------*/
int main (int argc, char* argv[])
{
  return csApplicationRunner<Simple>::Run (argc, argv);
}

The problem is at

if (!RegisterQueue(GetObjectRegistry(), csevAllEvents(GetObjectRegistry())))

With the RegisterQueue I get the error

Invalid arguments '
Candidates are:
bool RegisterQueue(iObjectRegistry *, ?)
bool RegisterQueue(iObjectRegistry *, ? *)
bool RegisterQueue(iEventQueue *, ?)
bool RegisterQueue(iEventQueue *, ? *)

And

  if (!OpenApplication(GetObjectRegistry()))

I get the Error

Function 'OpenApplication' could not be resolved


Now Ive taken the approach that the tutorial is correct so I'm guessing its to do with my environment.
I am using Ubuntu and Eclipse IDE. Setup using http://www.crystalspace3d.org/main/Eclipse_tutorial (yes i substituted the 'cs-config' with '$CRYSTAL/cs-config')
I build and installed crystalspace and included the Environment vars into .bashrc

export CRYSTAL=/home/edward/crystalspace/

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/edward/crystalspace/

my include directory is at

/usr/local/include/crystalspace

What have I missed?
 
Logged
edward84
Newbie
*
Posts: 2


View Profile Email
« Reply #1 on: November 06, 2011, 12:37:10 pm »

just a follow up for anyone else searching this problem.

The instructions for Eclipse no longer match correctly. I ended up having to look at the KDevelop tutorial for some of the settings. Also for some reason $CRYSTAL did not work and I was getting RYSTAL instead. I just used the full path to the crystalspace package to get it to work.

I am still getting errors in Eclipse though however the project now builds. I'm going to see if i can update the wiki for eclipse with how I setup the environment.
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 4.353 seconds with 15 queries.