To build sample in the DDPX using g++

Is there any sample g++ command example to build the sample application in the target hardware. Or necessary steps to be done to build in the hardware and no cross compiling.
I would like to know the libraries and directories to be included in the g++ compiler command in the target. Is this possible.
I tried to copy the sample src code and some reference files to the hardware, and used the below command:
g++ -I/usr/local/driveworks/include -I/usr/local/cuda/include -I/usr/local/driveworks-2.0/samples/src/framework/ -std=c++11 main.cpp interpreter.cpp /home/nvidia/foo/Tx/src/framework/ProgramArguments.cpp /home/nvidia/foo/Tx/src/framework/SampleFramework.cpp -ldriveworks -L/usr/local/driveworks/lib -o foo_tx

and ended up with lots of undefined reference to’s. Please let me know if this possible and if Yes! how?

Dear raghunandan,
DW samples can’t be compiled on board directly. You need to cross compile it on host and copy the executable oh board to run.

Hello SivaRamaKrishna,
I understand, thank you for confirmation. Is there any example to do cross compilation with g++ in the linux host? I found a example of HelloWorld in DriveWorks SDK Reference 2.0.2085 Release document. Are there other examples for sample applications other than helloworld ?

Hi raghunandan.sidhanti,

Please take a look at “Cross-Compiling for the NVIDIA DRIVE Platform (Linux)” section of “DriveWorks SDK Reference Documentation” in “Drive Software Development Guide”. Let us know if still have any questions. Thanks!

Hello,

I have seen this document, but is there any sample with cross compilation of sample using gcc in host computer? And also is there any document to cross compile some 3rd party libraries for Arm aarch64 architecture in the host computer to point at it during the cross compilation? Specifically I am using libpcap libraries in xavier. Right now I copy the code to the target hardware and then compile the code in the DDPX. But I wish to do cross compile in host computer, but I am looking for information to compile libpcap library for Xavier architecture. Is there some example which can help me ?

I believe driveworks sample cross compilation uses gcc binary in host computer and there are some 3rdparty libraries under the sample directory. Could you take a look at it?

As I understand you are talking about the folder /usr/local/driveworks/samples/3rdparty/linux-aarch64/ is that correct? Which has only cuda library. I am looking for instructions to actually compile the 3rd party source code into cross compiled library for ARM aarch64 for Xavier. Something similar to this https://kush.com.fj/blog/posts/2018-05-15-crosscompile-libpcap-for-arm/ .

I somehow managed to do cross compile in the host for 3rd party libraries. But is there any other example other than hello world example to use gcc for compile in host. For example: I found this in the reference document :
gcc -I/usr/local/driveworks/include/ -I/usr/local/cuda/include helloworld.cpp -ldriveworks -L/usr/local/driveworks/lib/ -lstdc++ -o helloworld

Is there any other example something similar for driveworks sample? For example I want to compile canbus sample application in the host using gcc. Is there any such example ?

I solved the problem with cmake. Thank you for the help.