Need some help understanding how to deal with libraries when developing for Toradex boards

I developed for embedded systems many many years. Until now it was always by using a host and cross compile for the target. Connect to target by some debugging port, download and debug. The well known bare-metal programming flow I guess.

But now we have processors that need an OS and containers. I did a lot of reading and watched tutorials. I understand it is still preferred to program and cross compile on a host computer. But what I do not understand is how to deal with libraries.
Suppose I want to use OpenCV on the target. I assume I have to install OpenCV on the target. But how does the host know about the OpenCV lib I installed?

Is there some tutorial that explains the complete development flow including the use of libraries?

(I plan to use the Verdin IMX8M-PLUS on the Verdin Developer Board)

Hello @simmania ,
Here you can see an example with libraries ( with libgpiod)

Best regards,

Unfortunately, this does not make thinks much more clear for me.

Firstly because this example is based on Visual Studio which is (if I understand correctly) not supported anymore. And for Visual Studio Code things are differently.

Secondly because libgpiod is already part of Torizon. But how to deal with libs that are not? Like OpenCV.

How do we install libs on the target when dealing with containers? How does the crosscompiler know about the lib. This is still unclear to me.

One way I do it is as follows:

  1. install the libraries in a container as per the above method linked.
  2. deploy container
  3. open container in iterative mode as in bash inside container.
  4. Then call the libraries as normal.

If you try apt-get install or something like snap, I don’t think that works directly from the bash as soon as you SSH to the device.

I’m rather new to Linux.
What is iterative mode and how do I open container in this mode?
What do you mean with call the libraries as normal?

How do I install the OpenCV library. I think I have to get the code from github and compile it.
Should I do that on target or on host? Or both? The process and how compiler/linker and runtime do know about it is still not clear to me.

we have an example of using OpenCV with Torizon:
Torizon Sample: Using OpenCV for Computer Vision | Toradex Developer Center.

What @SJ_BHD meant about “interactive mode” is related to Docker container technology. The interactive mode in Docker allows us to execute commands while the container is in a running state. I suggest you to learn more about container if you want to use Torizon. There are many free Online Courses - Learn Anything, On Your Schedule | Udemy. For example, this one is a good one to get started:
Free Docker Tutorial - Docker Essentials | Udemy

Also, we have this section of our documentation to develop applications with Torizon:
Application Development Documentation Overview | Toradex Developer Center
and the full documentation about Torizon: Torizon | Toradex Developer Center

Hello @simmania ,
Did the answer from @andi.tx solve your question? If so, can you please mark it as solution?

Best regards,