Linkage problem "Undefined Reference"

Asked

Viewed 41 times

1

I’m trying to compile a dynamic library that uses a static library. I’m using cmake and the problem I’m having are linkage errors, where static library methods are giving error "Undefined Reference".

What I’m trying to compile is this project i9corp/i9corp-voip-sdk, that uses pjsip.

If I compile on Linux (Debian) the compilation and linkage do not give error and at the end is generated my.so file, but if I compile on Windows (using Mingw) gives Undefined errors Reference everywhere where I have static library method calls.

I have tried to set the path of my Mingw in hand (no cmake) for him to find the includes and libs, but not even so not right.

In the stretch below full file available on github i9corp-voip-sdk is my dynamic library and pjproject is a static library that is in the directory ./third-parties/pjsip the other wsock32 ws2_32 Crypto ssl pthread libraries I put in to try to solve the problem but had no success.

Only that if I try to generate in Windows a static library instead of a dynamic library works. Only error if I try to generate dynamic library.

target_link_libraries(i9corp-voip-sdk pjproject wsock32 ws2_32 crypto ssl pthread )
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.