Code: Select all
scons -Q
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
Code: Select all
platform = ARGUMENTS.get('OS', Platform())
listinc = [
'include',
'/usr/include/OGRE',
'/usr/include/OIS',
]
cflags=['']
env_ogre=Environment(CPPPATH=listinc, LIBPATH='.', CCFLAGS = cflags)
env_xdrv=Environment()
conf = Configure(env_ogre)
if not conf.CheckCXXHeader('Ogre.h'):
print 'Ogre must be installed!'
Exit(1)
if not conf.CheckCXXHeader('OISPrereqs.h'):
print 'OIS must be installed!'
Exit(1)
if not conf.CheckLib('OgreMain'):
print 'OgreMain library must be in path'
Exit(1)
if not conf.CheckLib('OIS'):
print 'OIS library must be in path'
Exit(1)
main_program_list=Split("""
src/main.cpp
""")
libs_list=Split("""
OgreMain
OIS
""")
main_list = env_ogre.Object('bin/main.o', main_program_list, LIBS=libs_list, LIBPATH='.')
#xdrv_list = env_xdrv.Object('src/xdrvlib.o', 'include/xdrvlib.c', LIBS='X11')
xdrv_list = env_xdrv.Library('src/xdrvlib', 'include/xdrvlib.c', LIBS='X11')
env_ogre.Program(main_list, LIBS=libs_list+xdrv_list, LIBPATH='.')