Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug]Error In conanbuildenv LD_LIBRARY_PATH #17546

Open
crystalsky opened this issue Jan 4, 2025 · 2 comments
Open

[bug]Error In conanbuildenv LD_LIBRARY_PATH #17546

crystalsky opened this issue Jan 4, 2025 · 2 comments

Comments

@crystalsky
Copy link

crystalsky commented Jan 4, 2025

Describe the bug

StepA

proja

class conan_proja(ConanFile):
    name="proja"
    version="0.1"
    def requirements(self):
        self.requires("glog/0.3.5")
  
    def config_options(self):
        self.options["glog"].shared=True

There is A Libaray and A Excutable in ProjeA. The Libaray and Excutable use The Glog Libaray.
conan create .
Will Done When Create the Proja and c++ projects.

projb

class conan_projb(ConanFile):
    name="projb"
    version="0.1"
    def requirements(self):
        self.requires("proja/0.1")

And Use Create.
conan create . --build

Error: /usr/bin/lib: warning: libglfags_nothreads.so.2.2 , needed by /usr/lib/libglog.so.0, not found (try using -rpath or -rpath-link) //root/.coan2/p/glog46e0c3677c070/p/lib/libglog.so.0.3.5: gflags::FlagRegisterer::FlagRegisterer.... undifined symbol

Step2

  1. Add The Code To Gflags ConanFile Like This:
class GflagsConan(ConanFile):
    name = "gflags"
    version = "2.2.2"
    def package_info(self):
        ...
        ...
        if self.settings.os=="Linux" and self.settings.shared:
            self.buildenv_info.append("LD_LIBRARY_PATH", self.package_folder+"/lib")
        if self.settings.os=="Windows" and self.settings.shared:
            self.buildenv_info.append("PATH", self.package_folder+"/bin")
            self.buildenv_info.append("PATH", self.package_folder+"/lib")
  1. Recreate The Project
    sh cd projeb && conan create . --build ‍

  2. This Result the Project B Not Build Success. Found The Error Like This. No ':' in export LD_LIBRARY_PATH=xxx
    conanbuildenv-release-x86_64.sh
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH /root/.conan2/p/gflags46e0c3677c070/p/lib ‍

May Be Is A Bug or I use it with a mistake.
How To Fixed It quickly.

How to reproduce it

No response

@jcar87
Copy link
Contributor

jcar87 commented Jan 6, 2025

Hi @crystalsky

Make sure all the relevant recipes have a package_type that reflect what they are.

Most likely proja is missing a package_type:

  • shared-library if it is always a shared library
  • library with shared option if its configurable

@crystalsky
Copy link
Author

crystalsky commented Jan 6, 2025

thanks, i will try it with your options in two days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants