|
Experimental message problem. 2 Years, 3 Months ago
|
|
|
Foppa wrote:
Hello!
I have developed experimental messages as guided in tutorials and compiled them successfully. Makefile is copy of Makefile from libopenjaus folder, with the necessary changes. But when I use these messages in my component, let's say primitive driver, program crashes. It gives this symbol lookup error: "./main: symbol lookup error: ./main: undefined symbol: myExpMessageCreate". Same error comes from all of my own experimental messages. Messages are in libjaus/src/message/experimental folder, .h files are in include/message/experimental folder. I just upgraded newer version, can it be that there is problem with libjaus.so. If I do ldd main libjaus.so is found.
Foppa wrote:
Founded solution! Adding lines LD_LIBRARYPATH:/usr/mypath/libjaus/lib and export LD_LIBRARY_PATH to .bashrc file telling the run-time system where things are located.
|
|
|
|
There's 10 types of people in the world; those that understand binary and those that don't.
|
|
|
Re:Experimental message problem. 2 Years, 3 Months ago
|
|
|
Froppa wrote:
And problem continues. I have developed RTAI application controlled by JAUS messages. Problem is that you can not create realtime tasks if you are not superuser, and executing e.g. myExpMessageCreate() as superuser gives error described above.
Using OpenJAUS including myExpMessage is OK. I tried it with ojVehicleSim and it worked fine, when I added one myExpMessageCreate() in pd.c file
But when I do sudo su and try to execute ojVehicleSim, including my own experimental message, as superuser, I get error "./main: symbol lookup error: ./main: undefined symbol: myExpMessageCreate". I would be appreciate if someone could help me with this. OjVehicleSim? works fine as superuser without my own experimental message.
I believe the fundamental problem is that you are trying to include experimental messages in libjaus. This is not the recommended procedure. The make and make install scripts are not going to have knowledge of your experimental message and therefore will not properly link them into the libraries which are exported to the /usr/lib directory. You overcame this by using .bashrc to add your local library file to the LD path. However when you execute a binary using sudo you are executing it using the root environment (which doesn't have the extra path info). This is why you have the issue you describe.
The better approach is to take your experimental files (.h/.c) and add them to the local src and include directories of your application. This way they will be compiled directly into your application and not trying to pull them from the jaus library (libjaus). This will require that you distribute these files between the various components which will be using them, but in the long run it will be much more reliable and portable for you.
|
|
|
|
There's 10 types of people in the world; those that understand binary and those that don't.
|
|
|