Compiling meshgen (PandaAI) for os x

Has anyone compiled the navigation mesh tool for OS X? Is this even supported?

My attempts so far fail with the following dump:

Zeno-Gerakins-iMac:meshgen_v1.0_src zenogerakin$ g++ meshgen.cxx -o meshgen.o  -fPIC -02 -arch i386 -I /Developer/Panda3D/include -I /usr/include/python2.6
Undefined symbols for architecture i386:
  "TypeRegistry::ptr()", referenced from:
      register_type(TypeHandle&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, TypeHandle)in ccgA4xXH.o
  "TypeRegistry::register_type(TypeHandle&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)", referenced from:
      register_type(TypeHandle&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, TypeHandle)in ccgA4xXH.o
  "TypeRegistry::record_derivation(TypeHandle, TypeHandle)", referenced from:
      register_type(TypeHandle&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, TypeHandle)in ccgA4xXH.o
  "TypedObject::init_type()", referenced from:
      Socket_IP::init_type()     in ccgA4xXH.o
  "TypedObject::~TypedObject()", referenced from:
      Socket_IP::~Socket_IP()in ccgA4xXH.o
      Socket_IP::~Socket_IP()in ccgA4xXH.o
  "Notify::ptr()", referenced from:
      BitMask<unsigned int, 32>::set_bit(int)in ccgA4xXH.o
  "Notify::assert_failure(char const*, int, char const*)", referenced from:
      BitMask<unsigned int, 32>::set_bit(int)in ccgA4xXH.o
  "MeshGenerator::MeshGenerator(char const*, char const*)", referenced from:
      _main in ccgA4xXH.o
  "typeinfo for TypedObject", referenced from:
      typeinfo for Socket_IPin ccgA4xXH.o
  "TypedObject::_type_handle", referenced from:
      TypedObject::get_class_type()       in ccgA4xXH.o
  "_memory_hook", referenced from:
      MemoryBase::operator delete(void*)in ccgA4xXH.o
  "Socket_IP::_type_handle", referenced from:
      Socket_IP::get_class_type()      in ccgA4xXH.o
      Socket_IP::init_type()     in ccgA4xXH.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
Zeno-Gerakins-iMac:meshgen_v1.0_src zenogerakin$ 

Anyone have pointers? Thanks in advance!

Like any C++ code, you will have to link with the appropriate library files to define all of the missing symbols. That means adding -L /Developer/Panda3D/lib to the command line, and whatever library names you need; based on the error messages you quote, I think this will be at least -lexpress -lnativenet -lprc -ldtoolutil . And maybe some others. I don’t know where MeshGenerator is defined; I guess that’s part of PandaAI? So you’ll need to add those libraries too.

David

Hi drwr,

Thanks as always for the prompt reply! From this page:

panda3d.org/manual/index.php … n_Mac_OS_X

I had assumed that the linking was a second step, so I didn’t specify any libs.

I know I’m missing something, but what is beyond me. I’ll poke around in the pandAI stuff a bit more.

Thanks again.

I don’t include the pandAI main lib, just the meshgen code. This is probably the problem. Will update in a second.

Final try of the night:

Zeno-Gerakins-iMac:meshgen_v1.0_src zenogerakin$ g++ -Wall meshgen.cxx -o meshgen.o  -fPIC -02 -arch i386 -I /Users/zenogerakin/Projects/tile_rts/Pandai_v1.0_src -I /Developer/Panda3D/include -I /usr/include/python2.6 -I /Users/zenogerakin/Projects/tile_rts/panda3d-1.7.2/dtool/src
In file included from meshNode.h:20,
                 from aiMeshGenerator.h:17,
                 from meshgen.cxx:20:
globals.h:16: warning: ignoring #pragma warning 
globals.h:17: warning: ignoring #pragma warning 
globals.h:18: warning: ignoring #pragma warning 
Undefined symbols for architecture i386:
  "TypeRegistry::ptr()", referenced from:
      register_type(TypeHandle&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, TypeHandle)in ccj8IE8s.o
  "TypeRegistry::register_type(TypeHandle&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)", referenced from:
      register_type(TypeHandle&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, TypeHandle)in ccj8IE8s.o
  "TypeRegistry::record_derivation(TypeHandle, TypeHandle)", referenced from:
      register_type(TypeHandle&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, TypeHandle)in ccj8IE8s.o
  "TypedObject::init_type()", referenced from:
      Socket_IP::init_type()     in ccj8IE8s.o
  "TypedObject::~TypedObject()", referenced from:
      Socket_IP::~Socket_IP()in ccj8IE8s.o
      Socket_IP::~Socket_IP()in ccj8IE8s.o
  "Notify::ptr()", referenced from:
      BitMask<unsigned int, 32>::set_bit(int)in ccj8IE8s.o
  "Notify::assert_failure(char const*, int, char const*)", referenced from:
      BitMask<unsigned int, 32>::set_bit(int)in ccj8IE8s.o
  "MeshGenerator::MeshGenerator(char const*, char const*)", referenced from:
      _main in ccj8IE8s.o
  "typeinfo for TypedObject", referenced from:
      typeinfo for Socket_IPin ccj8IE8s.o
  "TypedObject::_type_handle", referenced from:
      TypedObject::get_class_type()       in ccj8IE8s.o
  "_memory_hook", referenced from:
      MemoryBase::operator delete(void*)in ccj8IE8s.o
  "Socket_IP::_type_handle", referenced from:
      Socket_IP::get_class_type()      in ccj8IE8s.o
      Socket_IP::init_type()     in ccj8IE8s.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
Zeno-Gerakins-iMac:meshgen_v1.0_src zenogerakin$ 

TypedObject.h is included with the above command. I guess this means that I have a version that doesn’t include the functions that are being called. I can think of two reasons - these functions are being compiler defined out because of the platform (I doubt it) or pandAI is written against the dev source.

I’ll look into this more tomorrow.

Thanks!

Ah, you did omit the -c parameter. This is what makes linking a second step.

David

sigh… I re-read your comment this morning and it makes me very depressed indeed. I’ll try again tonight, with probably improved results since I’ll actually be following the directions.

Thanks again!

well… almost…

I get it compiled to an o-file fine, but I’m missing a lib when I link

Zeno-Gerakins-iMac:meshgen_v1.0_src zenogerakin$ g++ meshgen.o aiMeshGenerator.o meshNode.o -o meshgen -fPIC -O2 -arch i386 -L/Developer/Panda3D/lib -lp3framework -lpanda -lpandafx -lpandaexpress -lp3dtoolconfig -lp3dtool -lp3direct -L/Users/zenogerakin/Projects/tile_rts/Pandai_v1.0_src
Zeno-Gerakins-iMac:meshgen_v1.0_src zenogerakin$ ./meshgen
dyld: Symbol not found: __Py_NoneStruct
  Referenced from: /Developer/Panda3D/lib/libp3dtool.1.7.dylib
  Expected in: dynamic lookup

Trace/BPT trap
Zeno-Gerakins-iMac:meshgen_v1.0_src zenogerakin$ g++ meshgen.o aiMeshGenerator.o meshNode.o -o meshgen -fPIC -O2 -arch i386 -L/Developer/Panda3D/lib -lp3framework -lpanda -lpandafx -lpandaexpress -lp3dtoolconfig -lp3dtool -lp3direct -L/Users/zenogerakin/Projects/tile_rts/Pandai_v1.0_src -L/usr/includepython2.5
ld: warning: directory not found for option '-L/usr/includepython2.5'
Zeno-Gerakins-iMac:meshgen_v1.0_src zenogerakin$ g++ meshgen.o aiMeshGenerator.o meshNode.o -o meshgen -fPIC -O2 -arch i386 -L/Developer/Panda3D/lib -lp3framework -lpanda -lpandafx -lpandaexpress -lp3dtoolconfig -lp3dtool -lp3direct -L/Users/zenogerakin/Projects/tile_rts/Pandai_v1.0_src -L/usr/include/python2.6
Zeno-Gerakins-iMac:meshgen_v1.0_src zenogerakin$ ./meshgen
dyld: Symbol not found: __Py_NoneStruct
  Referenced from: /Developer/Panda3D/lib/libp3dtool.1.7.dylib
  Expected in: dynamic lookup

Trace/BPT trap

That is two tries with some additional libs. When I try to include any of the libs that drwr references in his earlier post they are not found. Probably I don’t know the right path. Anyway, enough for tonight.

Thanks in advance if anyone sees what I have wrong!

I think you’ll also need to specify -framework Python.

!! victory.

Thanks everyone.