I am trying to integrate a third party software into my torizon project. For “build amd local”, my project was fine. I was able to run the container in Ubuntu successfully.
But when I ran the contain for arm64, it could not find the lib files.
/usr/bin/ld: cannot find -ltps_A: No such file or directory
/usr/bin/ld: cannot find -ltps_B: No such file or directory
where libtps_A.a and libtps_B.a (and .so files) are in /home/testtps/lib/.
The error message provided says “No such file or directory”. Can you confirm whether that is actually accurate or not? Are these library files at the locations in the container expected by the compiler?
Also how exactly did you include these third party libraries in the container?
I think I have an idea of what you might have done wrong. First of all keep in mind you need to make sure these files are available in the “correct” container. The container that compiles your code is not the same as the container that runs your code.
There is an intermediary container the “SDK container” that builds your code first. Then the compiled output is copied into the final application container. If you’re copying your libraries into the application container then they would not be available in the SDK container.
It runs the SDK container by bind-mounting the entire project workspace to ${config:torizon_app_root}" which defaults to /home/torizon/app in the container via your project’s setting.json. This is how your project’s source code is made available in the SDK container for compiling.
For example, imagine in your project you have your third-party libraries in the location of <project-folder>/lib. Then in the SDK container via this bind-mount they would be at /home/torizon/app/lib I believe. Keep that in mind when trying to work out the path that you should pass to the compilier via CMake.
For “build amd local”, my project was fine. I was able to run the container in Ubuntu successfully.
One final note, if you’re running the task build-debug-amd64-local. Then I don’t think this is being compiled or ran in a container. At least going by the definition of the task in tasks.json. This just compiles and runs your code locally using the tools on your machine. So it’s not quite comparable to the usual container workflow.