Qt SharedLibrary + CLR gives '__fastcall' incompatible Warning
Pettor last edited by
I have started to use QT for a project where there will be a shared library written in C++ for Windows, Linux, OSX, Android etc. This shared library will then be used in a platform specific client that will be using a langauge proper for that platform. Windows will use C#, OSX objective-c and Linux will most likley use a QT based interface.
So far I have a building environment up and running for Windows. I use a CLR wrapper that uses the unmanaged QT shared library and converts the result to something applicable for the managed C# world. This works fine for x64 without any warnings, but using x86 I get the following warning for 'qchar.h':
warning C4561: '__fastcall' incompatible with the '/clr' option: converting to '__stdcall' C:\QT\5.3\msvc2013\include\QtCore\qchar.h 457 1 SharedClientLibrary
There are a couple of functions there that use QT_FASTCALL and will result in this warning. I have made a test function in the QT library that manipulates a QString and then returns it in std:string format. The C# world have no problem getting the correct result even on x86 where the warnings are printed.
Is there anyway to fix this and is the convertion to '__stdcall' making it safe?
Also, how difficult will it be to use this shared library on the platforms? Any experience? The wrapper is a bit messy to have, but otherwise the Windows platform works good I think!