Linking a shared library with another shared lib in linux

前端 未结 3 1277
时光说笑
时光说笑 2020-11-27 04:52

I am trying to build a shared library. Let us say libabc.so .It uses another .so file , say lib123.so (a lib in /usr/local/lib) .Now i am using my shared lib libabc.so in my

3条回答
  •  长情又很酷
    2020-11-27 04:54

    When trying to create my own shared library that uses Berkeley DB, I found that I have to put the -ldb at the end of the gcc command or else it blew up saying the symbol 'db_create' was not found. This was under Cygwin.

    Specifically, this worked:

    gcc -shared -o $b/$libfile nt_*.o -ldb

    This did not work:

    gcc -ldb -shared -o $b/$libfile nt_*.o

提交回复
热议问题