riebl / vanetza

Open-source implementation of the ETSI C-ITS protocol stack
Other
200 stars 158 forks source link

Need Help in compiling vanetza with socktap #118

Closed 1AwesomeDeveloper closed 3 years ago

1AwesomeDeveloper commented 3 years ago

Hello, I am trying to build vanetza with socktap, on Raspberry Pi4 (single-board computer) attached with Vera-P174 (a V2X evaluation board) by UBLOX, I have successfully built LLC drivers for the Vera-P174 and socktap on my Raspberry Pi(Linux ubuntu 5.4.0-1025-raspi), and now I wish to use my own LLC API which is almost similar, as in the case deployed for Cohda MK5, but since the board is different we need to change directory paths for our own board. Can you please suggest the modifications required in vanetza for the compilation of socktap, so that it will look up its shared objects in the sibling lib directory so as to use my own LLC APIs(similar to Cohda Mk5)?

riebl commented 3 years ago

socktap does not link to any Cohda libraries, it just requires the Cohda llc-api.h header with the tMKxRxPacket and tMKxTxPacket structs. Please refer to cmake/FindCohda.cmake to see which paths of Cohda SDK are looked up. Usage of the Cohda LLC API is limited to the file tools/socktap/cohda.cpp, so you will only need to adapt this file if your LLC API is not entirely compatible.

1AwesomeDeveloper commented 3 years ago

thanks for your reply, I changed the cmake/FindCohda.cmake file and added my own paths, but I am getting this error image

Also my cmake/FindCohda.cmake file look like this image

As you can see I have llc-api.h in the following directory image

riebl commented 3 years ago

You can safely omit building the cohda_proxy tool by removing add_subdirectory(tools/cohda_proxy) from CMakeLists.txt.

1AwesomeDeveloper commented 3 years ago

Thank you, sir, for your response, I fixed the earlier issue by adding the path of "mk2-mac-api-types.h". But Currently, I am facing another issue in compiling. Here is the attached error (coming in llc-api.h) image

To me, it seems that we can't declare two flexible array members in the same structure, (c compiler allows it while cpp compiler doesn't). Can you suggest the required changes

riebl commented 3 years ago

Mixing C and C++ code requires to wrap the C code by an extern "C" block. I close this ticket because your issue is not a problem related to Vanetza itself.