conan-io / conan

Conan - The open-source C and C++ package manager
https://conan.io
MIT License
8.25k stars 980 forks source link

conan lib packge dll,conan exe use #17187

Open jun9090 opened 2 weeks ago

jun9090 commented 2 weeks ago

What is your question?

Requirement: I want to package a third party dll with Conan so that other Conan clients can use the third party dll directly Refer to the official link: https://docs.conan.io/2/tutorial/creating_packages/other_types_of_packages/package_prebuilt_binaries.html Docwnload the official code, use the prebuilt_binaries project, terminal conan export -pgg. -s os="Windows" -s arch="x86_64" Conan list hello/0.1#:* to see the hello package image

Then set Conan exe conanfile.py image

cmakelists.txt add find_package(hello REQUIRED)

But an error was reported while building image

Could you please help us see what the problem is, or what other methods are available

Have you read the CONTRIBUTING guide?

memsharded commented 2 weeks ago

Hi @jun9090

Thanks for your feedback.

It is likely that you are not exporting the static "import-lib" (and maybe not the headers). It would be good to have:

Please try to copy and paste the output as text, it helps so I can search, copy it, etc.

jun9090 commented 2 weeks ago

Thank you for your reply I made sure Conan executed the command correctly the command :conan export-pkg . -s os="Windows" -s arch="x86_64" -s build_type=Debug
output: image

conanfile.py: image

The exe then calls lib, conanfile.py: def requirements(self): self.requires("slc-ndilib/1.0") cmakeLists.txt image

the command :conan build . --output-folder=build --build=missing -s build_type=Debug output error: image What is the reason? Looking forward to your reply

memsharded commented 2 weeks ago

Thanks for your feedback and details.

It is weird, are you completely sure you used that conanfile.py? Because it doesn't make sense to me that it is complaining about library slc-ndilib when you have in the conanfile.py the other long name. Sure you didn't change the package_info() method after the initial conan export-pkg?

A couple of important details.