From: Claudio L. <c_l...@ho...> - 2005-12-12 20:12:02
|
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. Here is part of my configuration: checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes checking dynamic linker characteristics... darwin8.3.0 dyld checking which extension is used for loadable modules... .so checking which variable specifies run-time library path... DYLD_LIBRARY_PATH checking for the default library search path... /usr/local/lib /lib /usr/lib Any suggestion on what to try next? Thanks! Claudio. |
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 |
From: <se...@in...> - 2005-12-12 20:46:12
|
On Mon, 2005-12-12 at 12:12 -0800, 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. > > Here is part of my configuration: > > checking whether the g++ linker (/usr/bin/ld) supports shared libraries... > yes > checking dynamic linker characteristics... darwin8.3.0 dyld > checking which extension is used for loadable modules... .so > checking which variable specifies run-time library path... DYLD_LIBRARY_PATH > checking for the default library search path... /usr/local/lib /lib /usr/lib > > > Any suggestion on what to try next? > > Thanks! > Claudio. occ2 --help |
From: <se...@in...> - 2005-12-12 20:51:17
|
On Mon, 2005-12-12 at 12:12 -0800, 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 if from the examples/before directory try make or make BeforeClass make before-test |
From: <se...@in...> - 2005-12-12 21:00:10
|
On Mon, 2005-12-12 at 16:08 -0500, Gilles J. Seguin wrote: > On Mon, 2005-12-12 at 12:12 -0800, 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 > if from the examples/before directory > > try make > > or > make BeforeClass > make before-test was using wrong tree make before-test make BeforeClass.exe |