Question

Is there any problem or a way to use prints inside the code for a library file (libSoundTouch.so). I was working on library - SoundTouch, just adding some prints inside it's c++ code which results in creating the above and some other library file. Although it compiles and everything works but I cannot see the output of the prints on the screen (I checked dmesg log also, but could not see the output there also)

Am I missing something? Or, Is there any way to enable prints there?

Was it helpful?

Solution

Got it working finally.

The problem and what I did:

When we run soundstretch utility, it looks for a shared library libSoundTouch.so.0

I had the source code for soundtouch library and soundstretch utility. I was adding printfs in soundtouch source code and compiling and installing the soundtouch and soundstretch. The soundtouch library is installed in /usr/local/lib

I am using Ubuntu and apparently, you can directly install the soundstretch utility from Ubuntu software center which is installed in the correct path (which soundstretch looks for when it runs)

Now when I was running soundstretch utility, it was calling the library installed from the Ubuntu software center as it was in the default path. That's why I was not able to see any prints which I had added in the soundtouch library source code as those functions were never called.

So, one thing I removed the Ubuntu soundtouch library and added /usr/local/lib in the LD_LIBRARY_PATH variable and I can see printf's working now.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top