conan icon indicating copy to clipboard operation
conan copied to clipboard

conan lib packge dll,conan exe use

Open jun9090 opened this issue 1 year ago • 1 comments

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?

  • [X] I've read the CONTRIBUTING guide

jun9090 avatar Oct 18 '24 08:10 jun9090

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:

  • The full exact command, conan export -pgg. -s os="Windows" -s arch="x86_64" seems incorrect, I guess it will be conan export-pkg instead.
  • The full output of that command
  • The contents (list of folders and files) of the final package, you can see the folder with conan cache path hello/0.1:52222..(fullpackageid)

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

memsharded avatar Oct 18 '24 11:10 memsharded

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

jun9090 avatar Oct 21 '24 04:10 jun9090

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.

  • You want to put package_type = "static-library" in your package, to specify which type it is
  • The package() is actually packaging 2 libraries .lib, please check the output, this is likely undesired (Please try to share the feedback by copy&paste the text, not as images, as that helps searching for text and reading more clearly)
  • Dots in library names can be problematic sometimes. Conan generators try to handle that, but we know it might be problematic. I am not saying this is the issue, but it is worth checking, renaming to use _ instead of the dots for example, (also change the recipe) and try again.

memsharded avatar Oct 21 '24 07:10 memsharded

Hi @jun9090

Any further feedback here? If this is still an issue even if applying the comments above, I'd suggest to create a fully reproducible example, putting it in a Github repo you can share with us, so we can properly investigate and advice. Thanks for your feedback.

memsharded avatar Dec 03 '24 10:12 memsharded

thank you

---- Replied Message ---- | From | @.> | | Date | 12/03/2024 18:58 | | To | conan-io/conan @.> | | Cc | jun9090 @.>, Mention @.> | | Subject | Re: [conan-io/conan] conan lib packge dll,conan exe use (Issue #17187) |

Hi @jun9090

Any further feedback here? If this is still an issue even if applying the comments above, I'd suggest to create a fully reproducible example, putting it in a Github repo you can share with us, so we can properly investigate and advice. Thanks for your feedback.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

jun9090 avatar Dec 03 '24 11:12 jun9090

Closing this ticket as staled, but please don't hesitate to re-open or create a new ticket to continue, thanks for the feedback!

memsharded avatar Jan 09 '25 10:01 memsharded