Search code examples
javac++java-native-interfaceunsatisfiedlinkerrorlog4cxx

log4cxx builds and compiles but when run gets UnsatisfiedLinkException


I've added log4cxx logging to a small C++ wrapper/JNI bridge.

Originally it used a ton of printf statements, but as this started to get used more and more the console started to clog up, so i wanted to move to log4cxx instead.

The code compiles and builds fine. But when I try and run a java class called TestHarness I get:

Exception in thread "main" java.lang.UnsatisfiedLinkError: test/libMyApp.so: test/libMyApp.so: undefined symbol: _ZTIN7log4cxx7helpers13ObjectPtrBaseE

I'm a complete novice at C++, and have no idea what could be wrong. Any help greatly appreciated


Solution

  • Turns out this was because I hadn't copied over some shared objects to the correct directory (nor had I updated the file I was using).