vranki / ExtPlane

Plugin for X-Plane flight simulator which allows reading and writing simulation properties
138 stars 44 forks source link

Cannot compile plugin under Windows #54

Open Nagetier opened 5 years ago

Nagetier commented 5 years ago

Hi, I am trying to compile the plugin code under windows, using Qt 5.12.4 with MSVC 2017 64bit.

The first error I encountered is in extplane-plugin.pro: QMAKE_LFLAGS = += ../extplane-server/libextplane-server.a

The compiler would give me warnings that this file couldn't be located. As .a looks like a UNIX static library to me I changed it to .lib and match the output of what extplane-server is producing: QMAKE_LFLAGS = += ../extplane-server/extplane-server.lib

The compile error went away after that. However, I still cannot get a working .xpl file. The QMAKE_POST_LINK step would fail with an error, however a .dll is produced which on the other hand only has a size of 118KB (seemingly way off the size of the files you distribute). I renamed it to .xpl copy it over to X-Plane but when starting X-Plane I get the expected: Error Code = 126 : The specified module could not be found.

Is there anything I am missing when compiling the plugin? I was also trying to manually set it to 64bit as the architecture detection in the extplane-plugin.pro file is not properly working on windows as you mentioned in your comments as well.

Thanks!

vranki commented 4 years ago

Sounds like you're getting a shared (non-static) build.. The extplane-plugin.pro has QMAKE_LFLAGS += -shared which seems to do the trick on linux at least.

Could this be useful: https://wiki.qt.io/Build_Standalone_Qt_Application_for_Windows

Are you using Qt Creator or MSVC as build IDE?

I don't use Windows so probably I've broken the build in some change. Let me know if you get it fixed so I can update the project file and/or documentation.