Applications by linux-users

Questions and answers about 3Dconnexion devices on UNIX and Linux.

Moderator: Moderators

Post Reply
Absum
Posts: 53
Joined: Tue Apr 24, 2007 4:00 am
Location: Sweden
Contact:

Applications by linux-users

Post by Absum »

Is there anyone out there who has made applications in linux for the space navigator? It would be nice to hear from anyone who atleast have tried
UtaSH
Moderator
Moderator
Posts: 3754
Joined: Mon Nov 27, 2006 10:34 am
Location: Munich, Germany
Contact:

Post by UtaSH »

Hi Absum,

have you had a look to our SDK for Unix/Linux? If you want to work with it I can send you some documentation for it.

Uta
3Dconnexion
Absum
Posts: 53
Joined: Tue Apr 24, 2007 4:00 am
Location: Sweden
Contact:

Post by Absum »

Thanks some documentation would really be helpfull, I seem to be stuck at the moment trying to initialize the SDK/driver.

Code: Select all

include/xdrvlib.h:68: error: too many arguments to function 'int MagellanInit()'
include/BaseFrameListener.h:145: error: at this point in file
even tho the call is MagellanInit(xd, xw)
UtaSH
Moderator
Moderator
Posts: 3754
Joined: Mon Nov 27, 2006 10:34 am
Location: Munich, Germany
Contact:

Post by UtaSH »

Please try this:

add the following lines to xdrvlib.h

Code: Select all

#ifdef LINUX
#define ParameterCheck
#endif
or in case you did not #define LINUX only this

Code: Select all

#define ParameterCheck
Absum
Posts: 53
Joined: Tue Apr 24, 2007 4:00 am
Location: Sweden
Contact:

Post by Absum »

Code: Select all

g++ -o bin/release/main src/main.o include/xdrvlib.o -L. -lOgreMain -lOIS -lX11
src/main.o: In function `BaseFrameListener::setupSpaceNav(_XDisplay*, unsigned long)':
main.cpp:(.text._ZN17BaseFrameListener13setupSpaceNavEP9_XDisplaym[BaseFrameListener::setupSpaceNav(_XDisplay*, unsigned long)]+0x15): undefined reference to `MagellanInit(_XDisplay*, unsigned long)'
Still get basically the same error as i've gotten the last couple of hours i've tried getting this to work with ogre3d. The function is there and it takes the right parameters but me thinks it looks like its the linking thats the error.
UtaSH
Moderator
Moderator
Posts: 3754
Joined: Mon Nov 27, 2006 10:34 am
Location: Munich, Germany
Contact:

Post by UtaSH »

The message looks af if xdrvlib.c was not compiled and the linker can't find the xdrvlib.o ??

Are there any other warnings or errors before the linker message?
Absum
Posts: 53
Joined: Tue Apr 24, 2007 4:00 am
Location: Sweden
Contact:

Post by Absum »

No thats the only one... im using scons building system and im pretty sure it builds and links in the xdrvlib.o. But i do get the same error when not linking in xdrvlib.o :O
Absum
Posts: 53
Joined: Tue Apr 24, 2007 4:00 am
Location: Sweden
Contact:

Post by Absum »

Code: Select all

scons
scons: Reading SConscript files ...
Checking for C++ header file Ogre.h... (cached) yes
Checking for C++ header file OISPrereqs.h... (cached) yes
Checking for C library OgreMain... (cached) yes
Checking for C library OIS... (cached) yes
scons: done reading SConscript files.
scons: Building targets ...
g++ -o bin/main.o -c -Wall -Iinclude -I/usr/include/OGRE -I/usr/include/OIS src/main.cpp
include/xdrvlib.h:93: warning: 'int MagellanErrorHandler(Display*, XErrorEvent*)' declared 'static' but never defined
g++ -o bin/main bin/main.o src/xdrvlib.o -L. -lOgreMain -lOIS
bin/main.o: In function `BaseFrameListener::setupSpaceNav(_XDisplay*, unsigned long)':
main.cpp:(.text._ZN17BaseFrameListener13setupSpaceNavEP9_XDisplaym[BaseFrameListener::setupSpaceNav(_XDisplay*, unsigned long)]+0x15): undefined reference to `MagellanInit(_XDisplay*, unsigned long)'
collect2: ld returned 1 exit status
scons: *** [bin/main] Error 1
scons: building terminated because of errors.
Here is the whole output with -Wall specified.
UtaSH
Moderator
Moderator
Posts: 3754
Joined: Mon Nov 27, 2006 10:34 am
Location: Munich, Germany
Contact:

Post by UtaSH »

I can not see from the messages when the xdrvlib.c is compiled.
Can you find it in your directory src?
Absum
Posts: 53
Joined: Tue Apr 24, 2007 4:00 am
Location: Sweden
Contact:

Post by Absum »

Code: Select all

scons
scons: Reading SConscript files ...
Checking for C++ header file Ogre.h... (cached) yes
Checking for C++ header file OISPrereqs.h... (cached) yes
Checking for C library OgreMain... (cached) yes
Checking for C library OIS... (cached) yes
scons: done reading SConscript files.
scons: Building targets ...
g++ -o bin/main.o -c -Iinclude -I/usr/include/OGRE -I/usr/include/OIS src/main.cpp
gcc -o include/xdrvlib.o -c include/xdrvlib.c
ar rc src/libxdrvlib.a include/xdrvlib.o
ranlib src/libxdrvlib.a
g++ -o bin/main bin/main.o -L. -lOgreMain -lOIS src/libxdrvlib.a
bin/main.o: In function `BaseFrameListener::setupSpaceNav(_XDisplay*, unsigned long)':
main.cpp:(.text._ZN17BaseFrameListener13setupSpaceNavEP9_XDisplaym[BaseFrameListener::setupSpaceNav(_XDisplay*, unsigned long)]+0x15): undefined reference to `MagellanInit(_XDisplay*, unsigned long)'
collect2: ld returned 1 exit status
scons: *** [bin/main] Error 1
scons: building terminated because of errors.
There, i've modified the buildscript so that xdrvlib is compiled as a static library, don't know if that is correct but i get the same error and you can see that it compiles.
I've also created a new thread about this in the linux development forum... thought it would be more appropriate
UtaSH
Moderator
Moderator
Posts: 3754
Joined: Mon Nov 27, 2006 10:34 am
Location: Munich, Germany
Contact:

Post by UtaSH »

True. This thread makes more sense in the Developer's Forum for UNIX/Linux. See here.
Post Reply