Problem with .so linking

My application building with .so file is failing in the linking stage. When I make the file name as it is reporting not able to find the file and when I am naming it all the calls used in my application defined in the .so is reporting undefined reference. Pl. see if any of you can help me. I am struggling with it for quite a few days.

How are the link lines that cannot find being told to find it?

As for the undefined references, can you show what compilation flags are being used on one of its sources?

Undefined refrence with is solved. It was a coding issue. linking is required to be seen further.

Sorry I was away from my workstation and hence could not response you properly.
The code in CMakeLists.txt for linking library was as below

find_library(MyLib NAMES PATHS /home/skgoswami/Desktop/
target_link_libraries(MyFMI ${MyLib})

This was not able to locate the .so file despite path copied was perfect. I was advised by one colleague to append ‘lib’ to the .so file name, as gcc linker expects the same for .so. Though it was an unexpected solution but it worked after correcting the main calls defined in .so files. It was a black box FMU and hence I was not fully aware of the calls.
If you have any further observations pl. share.

NAMES might want to be just MySecond_digital here as the search knows to append the “normal” suffix. You can use --debug-find to get CMake to output information about its searches; that should help figure out why it doesn’t find the file.

I am in learning phase over cmake and surely will try your debug command. However now my application is getting built without ‘lib’ appending i.e. with Things are unexplainable why so. I was somehow not convinced with my colleague’s suggestion but it worked and was failing with my code. If code correction was the reason but then why it was reporting not able to find, so many doubts. Probably I will have to go back in reverse order to recreate. Let me see if I can and report you back. Thanks for your time trying to help me.