Forums - Link pthread in hexagon project

2 posts / 0 new
Last post
Link pthread in hexagon project
louis.chouraki
Join Date: 4 May 21
Posts: 1
Posted: Thu, 2021-06-17 03:15
Hello,
 
I am trying to create a hexagon project which need to open a local wav file.
I'm using the Hexagon SDK 4.3.0.0 installed from the Package Manager and the project has the empty executable format for a v66 DSP and uses the LLVM Toolchain 8.4.11, everything is installed on a Ubuntu 20.04 VM.
 
I have included fstream and iostream in the main file in order to open the .wav. So I also have added to the include path posix and qurt inc folders ( in rtos/qurt/computev66/include) because compiler was looking for them. But then I don't know how to link the corresponding libraries. Libc++.a and libc++abi.a are both looking for references to pthread functions without success. I tried to look in the multithreading example or others example using fstream to figure out how I can do it but it did not help. I also tried to add several flags in the link command (-lpthread, -pthread, -lposix, ..) but it does'nt work (cannot recognize namespec -lxx). Does anyone have an idea of how I am supposed to do?
 
To reproduce the issue, simply create a hexagon project with  a .cpp file with #include<fstream>. The issue seems pretty basic but I am a kind of newbie for this.
 
Regards,
Louis
  • Up0
  • Down0
rnoronha
Join Date: 24 Jan 20
Posts: 7
Posted: Thu, 2021-06-17 16:35
Hi Louis,
The calculator_c++ example in the Hexagon SDK and its documentation will be a good place to start. This example is using both fstream and iostream, so it should be useful for you.
In particular, take a look at the hexagon.min file. There is a section where we link the C++ libraries to the shared object. 
Perhaps you can start with building this example and modifying it as per your requirements to read the .wav file.
 
If you are still facing an issue, is it possible to share the build logs and the .min file you are using?
 
Thanks
  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.