From: Stefan S. <se...@sy...> - 2005-12-12 20:23:29
|
Claudio Levinas wrote: > Hello, > > I was able to generate shared libs out of a metaclass (only) by using > the following two statements: > > $ occ -c -m BeforeClass.mc > $ occ -mBeforeClass BeforeClass.o > > This yields the two shared libs "BeforeClass-init.so" and "BeforeClass.so". > > Note that "occ -m BeforeClass.mc " won't work (a lot of undefined symbols). > > > Anyway, when I try to compile the test program, I fail: > > $ occ -- -o before-test before-test.cc > EXECUTING: g++ g++ -D__opencxx -E -o before-test.occ -x c++ before-test.cc > unknown:0: the metaclass is not loaded: BeforeClass > EXECUTING: g++ g++ -o before-test before-test.ii > > > I tried to set the library path (DYLD_LIBRARY_PATH or even > LD_LIBRARY_PATH), and also tried putting the shared libs in > "/usr/local/lib", but still the metaclass won't load. [Caution: It has been a long time since I have last played with OpenC++, so this may only be vaguely helpful.] occ will attempt to load the metaclass from the BeforeClass.so plugin, using dlopen(). The plugin intself should therefor be found in either the local directory or via the LD_LIBRARY_PATH (or however it is spelled on your platform). I'm now sure how well occ deals with errors during the plugin loading. From your description above it sounds as if the missing symbols you encountered earlier could still be missing, but now only show up at load time. Just a shot in the dark... May be you can debug the loading phase itself, either by means of gdb, strace, or plain old 'std::cerr'. HTH, Stefan |