conan lib packge dll,conan exe use
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
Then set Conan exe conanfile.py
cmakelists.txt add find_package(hello REQUIRED)
But an error was reported while building
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
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 beconan export-pkginstead. - 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.
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:
conanfile.py:
The exe then calls lib,
conanfile.py:
def requirements(self):
self.requires("slc-ndilib/1.0")
cmakeLists.txt
the command :conan build . --output-folder=build --build=missing -s build_type=Debug
output error:
What is the reason?
Looking forward to your reply
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.
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.
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: @.***>
Closing this ticket as staled, but please don't hesitate to re-open or create a new ticket to continue, thanks for the feedback!