Posted By:
Sean_McClenathan
Posted On:
Tuesday, March 24, 2009 04:18 PM
OS: Cent OS 5.2 / Ubuntu 8.04 I have some C++ classes successfully wrapped through SWIG to a Shared Object file. The library loaded and ran correctly on the command line when I tested it, I gave it to my coworker and she was able to get it to load and run locally in eclipse, but when we try to deploy it as a WAR file to the Cent OS box we get a Unsatisfied Link Error when the server tries to load the Library. I am unsure if it is that the library is built incorrectly or because we're linking it incorrectly. If it's being incorrectly linked what is the correct way to link an .so file from within the WAR, if it's the case that the library is incorrectly built how should it be fixed? How we load the library:
More>>
OS: Cent OS 5.2 / Ubuntu 8.04
I have some C++ classes successfully wrapped through SWIG to a Shared Object file. The library loaded and ran correctly on the command line when I tested it, I gave it to my coworker and she was able to get it to load and run locally in eclipse, but when we try to deploy it as a WAR file to the Cent OS box we get a Unsatisfied Link Error when the server tries to load the Library. I am unsure if it is that the library is built incorrectly or because we're linking it incorrectly. If it's being incorrectly linked what is the correct way to link an .so file from within the WAR, if it's the case that the library is incorrectly built how should it be fixed?
How we load the library:
try
{
//System.load("/home/mathbio/ecc/Simulation.so"); //how we load on the desktop
System.load("/WEB-INF/classes/edu/unomaha/mathbio/JNIHandler/Simulation.so");//the path of the .so file within the WAR file
}catch(Exception e)
{
e.printStackTrace();
}
The swig specification file for Simulation.so:
%module CC
%include "cpointer.i"
%include "std_string.i"
using namespace std;
typedef std::string string;
%pointer_functions(int, intp);
%{
#include "Simulation.h"
%}
%include "Simulation.h"
The swig command I used to build the library is:
swig -java -package edu.unomaha.mathbio.JNIHandler -c++ Simulation.i
I'd appreciate any insight into the problem.
<<Less