Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
ActiveQt Examples fail with VS2010
magpielover last edited by
I have just accomplished the integration of Qt with VS2010.
I am able to open and run a Qt application (.pro file) without a flaw. However, when I try to build the dotnet examples in Qt\4.8.0\examples\activeqt\dotnet..., I get a persistent error. The error is as follows:
Warning 1 warning D9035: option 'clr:oldsyntax' has been deprecated and will be removed in a future release D:\user\kirbac\QtSDK\Desktop\Qt\4.8.0\examples\activeqt\dotnet\wrapper\lib\cl lib
Warning 2 warning C4561: '__fastcall' incompatible with the '/clr' option: converting to '__stdcall' d:\user\kirbac\qtsdk\desktop\qt\4.8.0\src\corelib\tools\qchar.h 310 1 lib
Error 103 error LNK2028: unresolved token (0A0003C4) "public: static class QString __cdecl QString::fromWCharArray(wchar_t const *,int)" (?fromWCharArray@QString@@$$FSA?AV1@PB_WH@Z) referenced in function "class QString __clrcall StringToQString(class System::String ^)" (?StringToQString@@$$FYM?AVQString@@P$AAVString@System@@@Z) D:\user\kirbac\QtSDK\Desktop\Qt\4.8.0\examples\activeqt\dotnet\wrapper\lib\tools.obj lib
Error 2 The type or namespace name 'netWorker' could not be found (are you missing a using directive or an assembly reference?) D:\user\kirbac\QtSDK\Desktop\Qt\4.8.0\examples\activeqt\dotnet\wrapper\main.cs 10 4 app
Warning 109 Could not resolve this reference. Could not locate the assembly "lib". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. app
Warning 110 The referenced component 'lib' could not be found.
This example is very important because it demonstrates how a C++ Qt class can be used in C# .NET environment. If I get it working, I will be able to access my own class from C# .
I cannot employ any VS solutions in the examples. Is there anyone who can help me with that?
2QTbobby last edited by
I've had similar errors and though I'm new to QT and .Net, I think I've found why these errors occur. Here's my experience, I hope it helps you.
"app" depends on "lib", but it isn't being built. When I rebuilt just the "lib" project, I got various CLR errors, which I fixed by right-clicking "lib" -> Properties -> C/C++ -> General and setting Common Language Runtime support to /clr:oldsyntax.
This gave me linking errors, which I found was due to wchar_t. An easy way to fix this is to right-click "lib"-> Properties -> C/C++ -> Language and set Treat WChar_T As Built in Type to No (/Zcwchar_t-).
There were some other property settings I modified, but I believe those were the main ones that fixed my problems.
Qt22 last edited by
thanks, this solved my errors