christian.wolf2 Posted September 9, 2020 Posted September 9, 2020 Hi, even if editor plugin tool is still in experimental state I want to dig into that topic and start to create my own editor plugin. I am following the tutorial from the documentation page and with some ups and downs because of CMAKE I was able to sucessfully generate the project and building a .dll file from it. When adding this dll to my project and try to load the plugin from editor, I get the following message: Am I doing something wrong or what additional steps needs to be taken in order to build an plugin? Are there anyone that have sucessfully created any plugin for Editor? Best Christian
devrom Posted September 9, 2020 Posted September 9, 2020 Hello Christian, I have experimented with Editor plugins before, so maybe I can help you. Plugins in general work for me with 2.11 and Linux. Did you change the source code or did you just copy/paste everything? Do you have the same problem if you just compile a minimal plugin with no content? Maybe share parts you changed and your CMakeLists.txt. Best regards
christian.wolf2 Posted September 10, 2020 Author Posted September 10, 2020 Hi ipg_rom, thanks for helping me out! I am trying to create the plugin for 2.11 as well, but for windows plattforms. Basically, I just copy/pasted all the necessary files from the documentation into the first plugin. So nothing was changed. Even the cmake files are the same. I was using cmake-gui for creating the project and every variable (even Qt5-framework) was discovered as expected. And from the cmake-log the project was successfully created and also built without any errors. I attached the CMakeLists.txt from the scr/-folder. BTW: The ONLY thing I changed was the #include paths from the QT-framework. All the core-files were located in QtCore-folder and not in the base one. Otherwise the paths to the QtWidget files has given me some errors. But this shouldn't be the issue I think. I also added an console-log image. So basically it says the "The specified module could not be found.". CMakeLists.txt
devrom Posted September 10, 2020 Posted September 10, 2020 Well, I dont think I can help you that much if you just copy/pasted and are on Windows. Did you compile a Release binary? If I use a debug library my editor just crashes right away.
sinbizkit Posted September 10, 2020 Posted September 10, 2020 Hi Christian, The error message you get isn't related to the Editor's plugin system itself, but it seems that the dynamic linker failed to load your library at runtime for some reason. The most common reason is that some additional dependencies can't be found or, maybe, their versions are different from those with which the library was compiled with (and some symbols are missing, for example). With what version of Qt did you compile the plugin?
christian.wolf2 Posted September 10, 2020 Author Posted September 10, 2020 @ipg_rom I compile a release binary. Didn't even tried debug one. @sinbizkit I build with vs 2017 x64 and are using Qt-Framework 5.12.6. So that should be okay, right? I also started a new project from scratch without including the Material-Tutorial, just the basic Plugin template and I got the same result. No errors or warnings during cmake-creation or building the .dll files. Just the error from the editor. Cheers
devrom Posted September 10, 2020 Posted September 10, 2020 Are you using the Qt libs that are located in the bin directory when creating a new default project or are you using your own Qt libs? Maybe there is a mismatch happening there.
christian.wolf2 Posted September 10, 2020 Author Posted September 10, 2020 Yes, I am using the Qt libs from the bin directory. I set the CMAKE_PREFIX_PATH as proposed by the Qt-documentation.
devrom Posted September 10, 2020 Posted September 10, 2020 Try replacing the Qt libraries in the bin directory with your own Qt libs.
roelof Posted September 11, 2020 Posted September 11, 2020 Hello Christian, When I start with expirementing editor plugins I have the same problem. Compiling ok, loading the plugin in Unigine give an error. The solution for me was: Choose in Visual Studio Managing configurations ... In the CMake Settings form you have under de General options the second option Configuration type. When I add the x64-Release configuration this option has the value RelWithDebInfo. I changed it to Release and the error by loading the plugin was gone. Maybe it wil work for you.
christian.wolf2 Posted September 11, 2020 Author Posted September 11, 2020 Hi all, many thanks for all the suggestions and the ongoing help. Unfortunately neither rebuilding the Qt source files from scratch nor trying it with UNIGINE 2.10 helped. Using Release build version was also considered during the first place (thanks roelof). So I will try it now with a different 5.12 Qt-version, and with newest 5.15 release. Will keep you updated. Just to be completely sure: I am only using an Evaluation version for Qt (since I want to first try it out before buying an licence). Building from Qt source files was therefor also build with "-opensource" command instead of "-commercial". I read that beside some special features, both version are identical. Might be that a reason why it always fails? Best and again thanks a lot for all the help. Much appreciated!
roelof Posted September 11, 2020 Posted September 11, 2020 Hi Christian, I work with version Qt 5.12.9 and the Unigine Community SDK for my editor plugins (without any problems). I could not get editor plugins working with Qt 5.15. Could you show your CMakeSettings.json file? (in the root directory of your editor plugin). 1
christian.wolf2 Posted September 11, 2020 Author Posted September 11, 2020 (edited) Hi roelof, sure, please find attached. Cheers CMakeSettings.json Edited September 11, 2020 by christian.wolf2
christian.wolf2 Posted September 21, 2020 Author Posted September 21, 2020 Hi all, short update from my side because problem was solved. I figured out, that the CMAKE-Gui doesn't override the UNIGINE_DOUBLE variable, which is why the system tries to build with single-precision libraries instead of double precision one. If anyone else have the problem, set the variable to ON manually in Unigine.cmake file on line three. option(UNIGINE_DOUBLE "Use double-precision build." ON) Afterwards, generating and building the plugin was done successfully and UNIGINE Editor found the application as intended. 1
Recommended Posts