dcsimg
java: symbol lookup error: ./libJvFollowLineImp.so: undefined symbol: _ZN7RunCtrlC1Ev
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Wednesday, January 24, 2007 11:57 PM

Hi all... I am new to JNI and I've been surviving through error messages so far by searching solutions in the internet. But this time I can't solve the problem. Please help me.... error message: class JvFollowLineMain { public static void main(String[] args) { JvFollowLine jfl = new JvFollowLine(); jfl.doFollowLine(args); } } class JvFollowLine { public native void doFollowLine(String[] args); static { System.loadLibrary("JvFollowLineImp"); } } #include "JvFollowLine.h" #if !MONITOR #include    More>>

Hi all...


I am new to JNI and I've been surviving through error messages so far by searching solutions in the internet. But this time I can't solve the problem. Please help me....




error message:



			
class JvFollowLineMain {
public static void main(String[] args) {

JvFollowLine jfl = new JvFollowLine();
jfl.doFollowLine(args);
}
}


			
class JvFollowLine {
public native void doFollowLine(String[] args);

static {
System.loadLibrary("JvFollowLineImp");
}
}


			
#include "JvFollowLine.h"

#if !MONITOR
#include
#else
#include
#endif
#include
#include

using namespace VXV;

JNIEXPORT void JNICALL Java_JvFollowLine_doFollowLine (JNIEnv *env, jobject obj, jobjectArray args) {

// Getting argc and argv
jsize argc = env->GetArrayLength(args);
char *argv[128];

for(int i = 0; i
jstring thObj = (jstring)env->GetObjectArrayElement(args, i);
char *thStr = (char*)env->GetStringUTFChars(thObj, 0);
argv[i] = thStr;
}

// Displaying the arguments (argc and argv)
for(int i = 0; i < argc; i++) printf("argc = %i; argv[%i] = %s
", argc, i, argv[i]);

try {
#if !MONITOR
RunCtrl run;
#else
mRunCtrl run;
vmonitor::show();
#endif
if (run.connect(argc, argv) < 0) {
printf("RunCtrl::connect: %s
", run.what());
exit(1);
}

// Move forward for 3 second
run.followLine(Position(0, 0, deg(0)));
VXV::Delay(3000);
run.stop();
VXV::Delay(1000);

} catch (std::exception& e) {
printf("exception: %s
", e.what());
}

return;
}



BTW: this program is to move a mobile robot forward for 3 second



Thank you....    <<Less

Re: java: symbol lookup error: ./libJvFollowLineImp.so: undefined symbol: _ZN7RunCtrlC1Ev

Posted By:   Robert_Lybarger  
Posted On:   Thursday, January 25, 2007 09:04 AM

java: symbol lookup error: ./libJvFollowLineImp.so: undefined symbol: _ZN7RunCtrlC1Ev

Sounds like your libJvFollowLineImp.so is trying to call a function it cannot find. This might be because the *.so file is borked for some reason (you might review how you created it, exactly) or it might just be that the "RunCtrl" code you are using cannot be found in the system environment. Looks like you're doing C++ style work in a unix environment. I haven't done JNI in a good little while -- I know they've changed all the dev tools a tad, so I might not know the proper way to create the *.so these days. Otherwise check what path(s) need to be in the environment to resolve the library calls your JNI itself is making: these sounds the more likely issue.

About | Sitemap | Contact