You need to link to the CS libraries and also give the path to the CS
include files to the compiler. The easiest way to do is to use the
cs-config tool to get those options. Check cs-config tool

On 5/11/06, Mildred <[EMAIL PROTECTED]> wrote:
Hi,

I'm trying to use Crystal Space. But I have problems compiling a very
simple application.
Here is the C++ code :

main.cpp:
============================================================
#include <cssysdef.h>
#include <csutil/sysfunc.h> // csPrintf
#include <cstool/initapp.h> // csInitializer

CS_IMPLEMENT_APPLICATION

int main(int argc, char* argv[]) {
    iObjectRegistry* object_reg =
        csInitializer::CreateEnvironment(argc, argv);
    if (!object_reg) return -1;
    return 0;
}
============================================================

I'm using Cmake to compile it.
Here are the (cleaned) g++ commands with the error messages :

c++ -o main.o -c main.cpp

c++ -fPIC main.o -o csWoT -rdynamic
    -L/home/mildred2/.local/lib -llua
    -lcrystalspace_opengl -lcrystalspace -lpthread -lz -lGL -lSM -lICE
    -lX11 -lXext -lm -lm -ldl -lnsl
    -Wl,-rpath,/home/mildred2/.local/lib

/usr/local/lib/libcrystalspace.a(initapp.o): In function
`csInitializer::GetDefaultAppID()':initapp.cpp:(.text+0x2e2): undefined
reference to `csStaticVarCleanup'

/usr/local/lib/libcrystalspace.a(initapp.o): In function
`SetupPluginLoadErrVerbosity(iObjectRegistry*)':initapp.cpp:(.text+0x869):
undefined reference to `csStaticVarCleanup'

:initapp.cpp:(.text+0x89a): undefined reference to `csStaticVarCleanup'

/usr/local/lib/libcrystalspace.a(initapp.o): In function
`csInitializer::CreateVerbosityManager(iObjectRegistry*)':initapp.cpp:(.text+0xb5c):
undefined reference to `csStaticVarCleanup'

:initapp.cpp:(.text+0xb90): undefined reference to `csStaticVarCleanup'

/usr/local/lib/libcrystalspace.a(initapp.o):initapp.cpp:(.text+0xe5a):
more undefined references to `csStaticVarCleanup' follow

/usr/local/lib/libcrystalspace.a(scf.o): In function
`scfInitialize(int, char const* const*)':scf.cpp:(.text+0x3a0b):
undefined reference to `scfStaticallyLinked'

/usr/local/lib/libcrystalspace.a(scf.o): In function
`scfImplementation<scfStringArray>::QueryInterface(unsigned long,
int)':scf.cpp:(.gnu.linkonce.t._ZN17scfImplementationI14scfStringArrayE14QueryInterfaceEmi[scfImplementation<scfStringArray>::QueryInterface(unsigned
long, int)]+0xd4): undefined reference to `csStaticVarCleanup'

/usr/local/lib/libcrystalspace.a(scf.o): In function
`scfImplementation1<scfStringArray,
iStringArray>::QueryInterface(unsigned long,
iStringArray>int)':scf.cpp:(.gnu.linkonce.t._ZN18scfImplementation1I14scfStringArray12iStringArrayE14QueryInterfaceEmi[scfImplementation1<scfStringArray,
iStringArray>iStringArray>::QueryInterface(unsigned long, int)]+0x145):
iStringArray>iStringArray>undefined reference to `csStaticVarCleanup'

:scf.cpp:(.gnu.linkonce.t._ZN18scfImplementation1I14scfStringArray12iStringArrayE14QueryInterfaceEmi[scfImplementation1<scfStringArray,
iStringArray>::QueryInterface(unsigned long, int)]+0x179): undefined
iStringArray>reference to `csStaticVarCleanup'

/usr/local/lib/libcrystalspace.a(virtclk.o): In function
`scfImplementation<csVirtualClock>::QueryInterface(unsigned long,
int)':virtclk.cpp:(.gnu.linkonce.t._ZN17scfImplementationI14csVirtualClockE14QueryInterfaceEmi[scfImplementation<csVirtualClock>::QueryInterface(unsigned
long, int)]+0xd4): undefined reference to `csStaticVarCleanup'

/usr/local/lib/libcrystalspace.a(virtclk.o): In function
`scfImplementation1<csVirtualClock,
iVirtualClock>::QueryInterface(unsigned long,
iVirtualClock>int)':virtclk.cpp:(.gnu.linkonce.t._ZN18scfImplementation1I14csVirtualClock13iVirtualClockE14QueryInterfaceEmi[scfImplementation1<csVirtualClock,
iVirtualClock>iVirtualClock>::QueryInterface(unsigned long,
iVirtualClock>iVirtualClock>int)]+0x145): undefined reference to
iVirtualClock>iVirtualClock>`csStaticVarCleanup'

/usr/local/lib/libcrystalspace.a(virtclk.o):virtclk.cpp:(.gnu.linkonce.t._ZN18scfImplementation1I14csVirtualClock13iVirtualClockE14QueryInterfaceEmi[scfImplementation1<csVirtualClock,
iVirtualClock>::QueryInterface(unsigned long, int)]+0x179): more
iVirtualClock>undefined references to `csStaticVarCleanup' follow

Can anyone help me with that ?
My source code is very simple ... I don't know what is wrong ... maybe
in the compile commands ... but I use cs-config to get the compiler
flags ...

Thanks

Mildred

--
Mildred       <xmpp:[EMAIL PROTECTED]> <http://mildred632.free.fr/>
Clef GPG :    <hkp://pgp.mit.edu> ou <http://mildred632.free.fr/gpg_key>
Fingerprint : 197C A7E6 645B 4299 6D37 684B 6F9D A8D6 [9A7D 2E2B]


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Crystal-main mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/crystal-main
Unsubscribe: mailto:[EMAIL PROTECTED]



--
Project Manager of Crystal Space (http://www.crystalspace3d.org)
and CEL (http://cel.crystalspace3d.org)
Support Crystal Space. Donate at
https://sourceforge.net/donate/index.php?group_id=649


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
Crystal-main mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/crystal-main
Unsubscribe: mailto:[EMAIL PROTECTED]

Reply via email to