Plugins not loading

45 views
Skip to first unread message

KF

unread,
Mar 1, 2012, 9:23:25 PM3/1/12
to Tiled Map Editor
I've written and compiled a plugin, it works just fine when I build
and use it from the QTDesigner. I can use the plugin to export in
both debug and release mode.

However, when I copy the .dll to the plugin directory of a clean
install of Tiled (using the installer on the main site) it does not
load. There are no error messages or anything, the plugin simply does
not turn up in the export dialog. I've tried copying the .dll from
release and debug with no luck.

I am using the compiler with the Microsoft SDK (7.1) to compile the
code. I suspect that the presence of "mingwm10.dll" means that the
windows installer uses code compiled with gcc. Is this why the .dll
doesn't load? I suspect that this is my problem, but before I go
install mingw etc... I figured I would ask.

Kevin

Thorbjørn Lindeijer

unread,
Mar 2, 2012, 3:34:14 AM3/2/12
to mape...@googlegroups.com

That is most certainly your problem. In particular, for the plugins to
load they need to be compatible with the Qt version against which
Tiled was built, and I don't think a MinGW build of Qt is compatible
with an MSVC build of Qt. There should be an error about this btw, but
I guess it may not show up in Windows because it is simply written to
stdout (it would be nice if Tiled had a Plugins dialog that showed the
list of plugins and whether they were loaded successfully).

The Windows release of Tiled is built using the Qt SDK, probably using
the latest stable Qt version for MinGW. I would personally recommend
using the Qt SDK to install "mingw etc", then you can be quite sure
your plugin dll will be compatible. It probably also has to be built
in release mode.

Best regards,
Bjørn

KF

unread,
Mar 2, 2012, 11:56:10 AM3/2/12
to Tiled Map Editor
Thanks for the reply.

Instead of going to bed last night I tried just that. To keep things
simple I downloaded a fresh copy of the source as well, so that I
could get a build working before I added my plugin. When I load the
project "tiled.pro" in QT builder and switch the project to MinGW and
try and build, the build fails. The error message I get is this:
:-1: error: Projects\bjorn-tiled-e1d7313\src\plugins\flare\..\..\..
\plugins\tiled\libflare.a: No such file or directory

I tried to figure out what the problem was but haven't had any luck
yet. I've attempted the build in normal and shadow mode. This error
occurs before I add a custom project. I've also confirmed that the
error is not restricted to the flare plugin: if I reorder the projects
or remove one, the build always crashes on the first attempt to build
a plugin project. This failure also occurs if I try to build an
individual plugin by right clicking on a single project and selecting
build: I get the same error, namely that lib_____.a cannot be found.

If you have any ideas, I would be happy to explore them. If this is a
reoccuring error for people developing in Windows I'd be happy to
write up the fix for the wiki as well. I would love to get this
plugin working, as I teach at a college and don't want to have to push
a full copy of tiled to all the machines with the new plugin, but
would rather just distribute the .dll.

Kevin



Kevin

On Mar 2, 3:34 am, Thorbjørn Lindeijer <thorbj...@lindeijer.nl> wrote:

Thorbjørn Lindeijer

unread,
Mar 3, 2012, 10:53:34 AM3/3/12
to mape...@googlegroups.com
Hello Kevin,

I tried on Windows 7 and unfortunately I couldn't reproduce your
problem. I have installed:

* Qt SDK 1.2 with:
- Desktop Qt 4.7.4 - MinGW (this is the Qt the 0.8.0 release was
compiled against, so use that rather than 4.8)
- MinGW 4.4

My repository is on the v0.8.0 tag, I ran 'git clean -dxf' to make
sure it had no residues.

Then I open the top-level tiled.pro in Qt Creator and press build.

One thing that I think may be a problem, though I can't see whether
this is the case, is when either Tiled or the Qt SDK is located in a
path with spaces in them. Some wrong quoting somewhere, which is
unfortunately not unlikely when spaces are involved, could mess up the
build.

Btw, I noticed you are compiling Tiled at commit e1d7313, which is the
current master. This is not recommended when you want your plugin to
be working with the 0.8.0 release, because on the master branch there
have been two additions to libtiled, which could be missed by your
plugin when it's combined with an older version of libtiled (the one
that shipped with 0.8.0). Probably it's not an issue when you're not
using those functions, but just thought I'd point that out.

Well, I hope you get it to work. Great that you're using Tiled in your
lessons, btw. :-)

Best regards,
Bjørn

KF

unread,
Mar 3, 2012, 2:39:08 PM3/3/12
to Tiled Map Editor
Bjørn,

I got it all working. Thanks a lot for your help. I owe you an entry
in the wiki... it will be entitled "how to not get a plugin
working". :)

Turns out I shouldn't try and solve the problems when I'm this
tired... your posting above is a veritable cornucopia of things I
screwed up:

The "file not found" was indeed spaces in the path. Mingw does not
like space, while MSVC works just fine, my project was in a directory
that included a space.
I had the wrong version of QT desktop, 4.8 instead of 4.7.4
I originally built the plugin with 0.8.0 source, I'm not sure why or
when I downloaded the current master. It's been that kind of week.

I was curious as to whether or not the MSVC compiled .dll would work
if I build against QT 4.7.4,so I installed the 2008 compiler and gave
it a try. No dice.

We use tiled in our program for a lot of things. We make the students
write XML parsers (which is great practice for them) and simple
platformer games using tmx files. I've since written a game in
Unity3D that uses a custom format generated by my tiled plugin. The
format needs a lot of work until it is sufficiently general, but I'm
hoping to submit it for release at some point, since it outputs a .js
file with all the important attributes of the level stored as
variables.

Anyhow, thanks for the help!

Kevin


On Mar 3, 10:53 am, Thorbjørn Lindeijer <thorbj...@lindeijer.nl>
wrote:
Reply all
Reply to author
Forward
0 new messages