PDA

View Full Version : Qt Creator plugin is failing at startup with cannot load library;



mut
18th June 2014, 22:00
Hello;

I wrote a Qt Creator plugin. For this purpose I had to compile Qt Creator from the sources. However I'm encountering this issue:

1. Starting the plugin from the "compiled from the sources" Qt Creator works fine.

2. Starting the plugin from the installed Qt Creator (from the official installation package) causes:
Cannot load library myplugin.dll : the specified specified procedure could not be found.

Thanks for any help;

Mut.

ChrisW67
19th June 2014, 09:22
Are you using the same compiler (provider, version and bit-ness) as was used to build the binary Qt Creator you are targeting? On Windows this will be a version of Microsoft's compiler (not MingW) that you can see in the Help About dialog.

mut
19th June 2014, 16:38
Thanks for the reply.
I'm working on Windows. My Qt Creator sources (sources for Qt Creator 3.0.0) were compiled with MingW. My plugin works fine with the QCreator exe resulting from this compilation. The installed Qt Creator is also version 3.0.0 and Qt is version 5.2.0.

Qt Creator sources: http://download.qt-project.org/official_releases/qtcreator/3.0/3.0.0/
Qt 5.2.0 with installed Qt Creator application and MingW: http://download.qt-project.org/archive/qt/5.2/5.2.0/qt-windows-opensource-5.2.0-mingw48_opengl-x86-offline.exe
Sample Qt Creator plugin used to build my own plugin: http://doc.qt.digia.com/qtcreator-extending/first-plugin.html

Added after 39 minutes:

Inserted images are the two Qt Creators. The one from the source used MingW while the other used MSVC.
10431
10432

TimsonC2000
20th June 2014, 13:37
The provided QtCreator from the official releases is compiled with a Visual Studio compiler. So you need to use the same. You can check that with dependency walker: http://www.dependencywalker.com/

With that tool you can see a dependency to msvcr100.dll which means it was built with Visual Studio 2010.

So to be able to build a plugin against a fresh QtCreator on Windows you need a Visual Studio 2010 with all updates/service packs and then you need a Qt with the same configuration how the QtCreator was built.
You can try to get this configuration from the build scripts https://github.com/qtproject/qtsdk. Or you can just use the Qt which comes with the installer, which was the used Qt to build QtCreator some weeks ago when I checked that.

mut
23rd June 2014, 21:33
How to use the build script?
Again I'm trying to compile Qt Creator 3.0.0. I have followed what you said and switched to MSVC. However, I'm having this problem:


Why it is not working?

I have installed MSVC Express 2010

I have put qt here: C:\Qt\Qt5.3.0

I have put Qt Creator sources here: C:\work\qt-creator-opensource-src-3.0.0

My windows path is:
C:\Qt\Qt5.3.0\5.3\msvc2010_opengl\bin;
C:\Perl64\bin;
C:\jom
Perl and Jom are both installed and in the Windows path:

When going into the Visual C++ Express DOS prompt and navigating where my Qt Creator project is, I type:


C:\work\qt-creator-opensource-src-3.0.0>configure -developer-build && jom
'configure' is not recognized as an internal or external command,
operable program or batch file.


Configure is not recognize.

anda_skoa
24th June 2014, 08:54
Are you sure Qt Creator has a configure script?

My README says to run qmake -r and then make (in your case nmake)

Cheers,
_

mut
24th June 2014, 14:40
No, it does not have configure script. How to get configure.bat?

Added after 17 minutes:

I have run qmake -r on the .proj and have obtained the Makefile

However, On “Visual Studio x64 Win64 Command Prompt (2010)”
command prompt (in Start > Programs > Microsoft Visual Studio 2010 > Visual Studio Tools:

C:\work\qt-creator-opensource-src-3.0.0>nmake

Microsoft (R) Program Maintenance Utility Version 10.00.40219.01
Copyright (C) Microsoft Corporation. All rights reserved.

NMAKE : fatal error U1065: invalid option '-'
Stop.

C:\work\qt-creator-opensource-src-3.0.0>

mut
24th June 2014, 17:09
1. These are the failures that I'm encountering:

C:\work\qt-creator-opensource-src-3.0.0>nmake

Microsoft (R) Program Maintenance Utility Version 10.00.40219.01
Copyright (C) Microsoft Corporation. All rights reserved.

NMAKE : fatal error U1065: invalid option '-'
Stop.

C:\work\qt-creator-opensource-src-3.0.0>env -u MAKE -u MAKEFLAGS nmake.exe /a /l

Microsoft (R) Program Maintenance Utility Version 10.00.40219.01
Copyright (C) Microsoft Corporation. All rights reserved.

NMAKE : fatal error U1073: don't know how to make 'C:/QNX650/host/win32/x86/usr/a' Stop.

C:\work_msvc\qt-creator-opensource-src-3.0.0>configure -developer-build -opensource -prefix C:\Qt\Qt5.2.0

'configure' is not recognized as an internal or external command,
operable program or batch file.

C:\work_msvc\qt-creator-opensource-src-3.0.0>nmake release

Microsoft (R) Program Maintenance Utility Version 10.00.40219.01
Copyright (C) Microsoft Corporation. All rights reserved.

NMAKE : fatal error U1065: invalid option '-'
Stop.

2. When compiling the sources of my plugin: should my Qt Creator kit be pointing to MSVC instead Ming?

Added after 17 minutes:

3. How to change MAKE and MAKEFLAGS to point to my installed MSVC?

anda_skoa
25th June 2014, 07:32
Maybe you ran the wrong qmake, i.e. not the one from your Qt compiled with MSVC

Cheers,
_

mut
25th June 2014, 14:01
Is it not that I'm not pointing to MSVC by using 'C:/QNX650/host/win32/x86/usr/a'

anda_skoa
25th June 2014, 15:10
Are you sure that is your installation of Qt built with MSVC?

The path looks like the host tools from a QNX SDK.

Cheers,
_

mut
25th June 2014, 15:36
I have put my Qt at C:/Qt/Qt5.2.0

How to set MAKEFLAGS

anda_skoa
25th June 2014, 16:27
I have put my Qt at C:/Qt/Qt5.2.0

Well, the qmake you ran is obviously from a different path.
Run the correct qmake

Cheers,
_