Skip to content

Another example where my_lib is a shared library #10

Open

Description

@nejcgalof

It is possible to create another example like my_lib where my_lib is a shared library (.so). I try it, but I have problems when I link it to the tests. It is good practice to test a shared library in this way, or is it better to create a static and shared library, and link a static to the tests?

Activity

  1. nejcgalof commented on Jul 15, 2022

    @nejcgalof
    ContributorAuthor

    Specially I have the problem with target_link_libraries(demo_shared PRIVATE project_options project_warnings).
    Then got the error:

    /usr/bin/ld: /lib/x86_64-linux-gnu/libasan.so.6: warning: the use of `tmpnam' is dangerous, better use `mkstemp'
    /usr/bin/ld: /lib/x86_64-linux-gnu/libasan.so.6: warning: the use of `tempnam' is dangerous, better use `mkstemp'
    /usr/bin/ld: /lib/x86_64-linux-gnu/libasan.so.6: warning: the use of `tmpnam_r' is dangerous, better use `mkstemp'
    ==18105==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.
    ==18106==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.
    CMake Error at /root/.conan/data/catch2/2.13.9/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/lib/cmake/Catch2/CatchAddTests.cmake:79 (message):
      "xml" is not a valid reporter!
    

    Because of this, an example of a shared library will be good.

  2. aminya commented on Jul 15, 2022

    @aminya
    Owner

    We should be able to do that by setting BUILD_SHARED_LIBS for my_lib.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions