Closed alexandrumc closed 2 years ago
You can, just add it to the EXTRA_CLING_ARGS
envar. Also, that error message is wrong, so you could simply bypass it with #define __PIC__
.
Good to know, thanks! Worked on Linux. However, on Windows, when I try to load, for example, Qt6Core.dll
, I get this:
> cppLoadLibrary("Qt6Core.dll")
cling::DynamicLibraryManager::loadLibrary() [C:\Dev\workspace\sil-cling\vcpkg\installed\x64-windows\bin\Qt6Core.dll -> C:\Dev\workspace\sil-cling\vcpkg\installed\x64-windows\bin\Qt6Core.dll]: LoadLibrary: returned 126: The specified module could not be found.
"Qt6Core.dll"
Process Monitor says that it finds all the dependencies it needs.
cppLoadLibrary
is just calling https://github.com/wlav/cppyy-backend/blob/master/clingwrapper/src/clingwrapper.cxx#L2833
The error message seems to come from here: https://github.com/root-project/cling/blob/master/lib/Interpreter/DynamicLibraryManager.cpp#L380
Make sure that the targets match: i.e. that both your clingwrapper build and Qt install are for either 32b or 64b builds, not a mix of them, and that both are either debug or release and MT or not, not a mix of them (each would lead to loading different C++ standard libraries).
You can also try to open the file with Python's ctypes
instead. That sometimes gives better error messages:
>>> import ctypes
>>> d = ctypes.CDLL("Qt6Core.dll")
You may need to provide the full path to Qt6Core.dll
here.
(I understand you're not using Python here, but this should provide a cross-check on missing symbols etc.)
Presumed resolved after no updates/further questions for 2 months. Feel free to reopen or start a new issue if no the case.
Yes, it was solved but I forgot to update the issue. Thank you.
I tried today to call Qt (the example from here https://www.qt.io/blog/2018/06/15/scripting-in-c) but when I
cppyy_compile("#include <QtWidgets/qapplication.h>")
I getIt would be nice to be able to able to pass, say,
-fPIC
as a flag for compilation.