-
Notifications
You must be signed in to change notification settings - Fork 982
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
[question] How to reference .dll in Visual Studio #17293
Comments
Hi @zxuan99 Conan uses packages with some "generators", for example it uses the Then, for runtime dependencies, Conan uses the For IDEs, there are some generators that provide some support, for example Can you please report the full consumer conanfile, the exact |
Hi @memsharded Thanks for the reply and I appreciate it. As mentioned, the library that I am uploading to the conan server is pre-built so there is no build steps required. I am using Visual Studio so the build system is MSBuild. Please refer to the following for the conanfile.py. import os required_conan_version = ">=1.55.0" class UHDConan(ConanFile):
|
I meant, the In the producer
Then, the important information needed is:
|
Hi, Sorry, I am a new Conan user and I do not quite get what you mean by consumer/producer conanfile. All I am trying to do is to create a package to upload to my private conan server so that it will automatically be linked and used in my Visual Studio to build it. For context, I have a library files with pre-built binary and I am trying to turn the package into a Conan library. Based on what you have mentioned, it seems like the Conanfile.py that I have written is wrong? Appreciate your advice on this. Thanks |
The producer is the The consumer is the |
Hi, But it is a pre-built binary. Do I still have to use "generators"? And another question is that I am using Visual Studio to link the libary. So am I supposed to use "MSBuild" or "CMake"? |
To add on, I am following the instructions stated in https://docs.conan.io/2/tutorial/creating_packages/other_types_of_packages/package_prebuilt_binaries.html - Packaging already Pre-built Binaries It did not mention anything about CMake/MSBuild. May I ask if I am referring to the correct set of instructions? The library that I want to wish to be uploaded to Conan and used in Visual Studio is pre-built as mentioned. |
In the consumer side, yes. It doesn't matter if the package is built from a pre-built binary or you build the package from source. When you are consuming the package, it is exactly the same, it is a binary. And the consuming project will have its own build system to built itself, CMake, Meson, MSBuild, or whatever. The generators should be used in the consumer side, not necessary in the package side. For example, when you use a
When you write
|
Hi, This is my consumer conanfile.py from conan import ConanFile
My producer conanfile.py is in the previous comment. I am still facing the same issue - runtime error which shows an error that "uhd.dll" was not found May I ask if there is any more lines that I need to add to my consumer conanfile.py so that it is able to find the "uhd.dll"? |
The "consumer" conanfile, when doing Are you adding some of those files to your VS project? Read the paragraph from that page:
|
I have checked the conan folder. It has both conandeps.props and conan_uhdp.props. Within conandeps.props, it also has the following line under ImportGroup. |
You have to pick one of those files, depending on what you want, and add it to your VS project (like in the project view -> Property Manager view -> right button -> Add Existing Property View). Or edit directly your |
What is your question?
Hi, I am using a pre-built library binary that I have uploaded into my private conan server and my application is using that . After I uploaded it, I have a runtime error and my application shows an error that "uhd.dll" was not found. But I have already added the following statement in my Conanfile.py in the library and the uhd.dll is indeed in the application's build folder under "C:\Users\user.conan2\p\b\uhdf0f5441a1bd05\p\bin" as I have cross checked it after building my application.
def package(self):
copy(self, "*.dll", bin_folder , os.path.join(self.package_folder, "bin"), keep_path=False)
By the way, I am using Visual Studio. May I ask what do I short of?
Have you read the CONTRIBUTING guide?
The text was updated successfully, but these errors were encountered: