Skip to content
This repository was archived by the owner on Apr 20, 2025. It is now read-only.
This repository was archived by the owner on Apr 20, 2025. It is now read-only.

undefined reference to pthread_once #3

Description

@dappiu

On Ubuntu Server 14.04.2 LTS launching ./Buildit script gave me some pthread_* undefined references when compiling file OSMutex.cpp

I solved editing Buildit script moving "-lpthread" as the last -l option on the variable CORE_LINK_LIBS

CORE_LINK_LIBS="-lstdc++ -lm -lcrypt -ldl -lpthread"

But then I received some errors about undefined references to dlopen() then I modified again CORE_LINK_LIBS this way:

CORE_LINK_LIBS="-lstdc++ -lm -lcrypt -lpthread -ldl"

ran ./Buildit clean, then ./Buildit and finally the compilation reached the end without errors.

As stated here the link order of libraries is important and maybe different linkers inspect the libraries in different orders.

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions