Loading dynamic library issue
-
Hi All,
I have one dynamic library as we are loading at run time from code so we have common code that are working on both windows and linux.
In windows name of librayr is library.dll and for linux it is liblibrary.so file. If i want to load the library and put the code common then is there any functionality in Qt that will internally take care of architecture ?
I don't want to put the ifdef macro for architecture
Please let me know how can i do through common code for windows and linux for loading the dynamic library ?
Thanks,
-
"QLibrary":http://qt-project.org/doc/qt-4.8/qlibrary.html takes care of that for you, you only need to load "library" and Qt will add the platform-specific parts of the file name for you.
-
No, there is no way to use the same library on windows and linux. You can use the same source code and build two libraries (one for linux, one for windows).