Hello,
i want to include dynamicly dll's. Is there a way without link header files in the main project?
Hello,
i want to include dynamicly dll's. Is there a way without link header files in the main project?
I'm not sure that your question makes sense. Dlls are dynamic by definition. If you mean you only want to link a dll under certain conditions you could use compile time flags such as:
Qt Code:
#define YES_I_WANT_DLLS //comment this line out if you don't want them #if defined YES_I_WANT_DLLS #include someLibrary #endifTo copy to clipboard, switch view to plain text mode
and then your program will only check the dlls if that line is uncommented.
If it's trouble including DLLs you need to:
-include the library using your IDE or standard syntax
-add the DLL's location to your "PATH" variable (or move the dlls to a location already in your path variable OR your current directory OR the directory of your .exe)
I don't think this is the OP's problem. I think he wants to load a DLL at run-time, but doesn't have the header files that define the classes and methods inside them so he can't compile that into the source code that uses the DLL.If you mean you only want to link a dll under certain conditions you could use compile time flags
I don't know how you can do that unless you have some knowledge of what the DLL contains and can tell your program at compile time how to use it, at least to the level of knowing function names and signature.
The QLibrary class has support for dynamic loading of DLLs; you can use the QLibrary::resolve() method at run-time to retrieve a pointer to a method with a known name contained in the library. There are specific requirements for how symbols must be exported from the library when it is compiled.
<=== The Great Pumpkin says ===>
Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.
Bookmarks