csharp with qt
-
wrote on 10 Jan 2017, 08:27 last edited by
*how to use csharp .dll in qt
-
Lifetime Qt Championwrote on 10 Jan 2017, 08:30 last edited by mrjj 1 Oct 2017, 08:35
Hi
You mean to call a function in it ?
or how to use ?It is not possible to use classes exported from it in any easy way.
As far as i know, you must export com objects and use those in c++.Maybe visual studio offer some help in this area.
You can google "csharp dll in qt" and read all the suggestions.
-
wrote on 10 Jan 2017, 09:18 last edited by VRonin 1 Oct 2017, 09:18
You need to compile with clr set on.
In visual studio 2013:
- project properties->configuration properties->general-> common language support -> /clr
- project properties->configuration properties->C/C++->Code generation-> Enable C++ Exceptions->/EHa
- project properties->configuration properties->C/C++->Code generation-> Runtime Library->/MD (or /MDd in debug)
- The 3 options above can be applied even to a single .cpp file instead of the whole project, just right click on the file instead of the project
- project properties->common properties->add new reference->drowse->browse->select the C# dll
- use #using <MyCSharpLibrary.dll> at the top of your .cpp file
- To write managed code you need a dialect of C++ called C++/CLI
-
wrote on 25 Jul 2017, 11:17 last edited by
@VRonin sir,
Thank you sir,successfully added .dll file in QT but i create visual c++ project(MFC application),here display error like LNK2020 and LNK2001 -
wrote on 25 Jul 2017, 11:23 last edited by
sir ,here i have add .cs( c sharp) file or .cpp (visualc++) file.
suppose i add .cpp file means errors are(afxmn...) -
@VRonin sir,
Thank you sir,successfully added .dll file in QT but i create visual c++ project(MFC application),here display error like LNK2020 and LNK2001@Rameshguru said in csharp with qt:
LNK2020 and LNK2001
Please show the whole error messages not just these numbers.
What does this mean: "suppose i add .cpp file means errors are(afxmn...)"? -
wrote on 26 Jul 2017, 04:27 last edited by
@jsulm sir,
first i create visuall c++ mfc application project then add library files.
here .cpp files there (or) .cs files are there,first i go to proerties->add exising item which file are add .cpp or .cs file
please explain clearly jsulm sir -
@jsulm sir,
first i create visuall c++ mfc application project then add library files.
here .cpp files there (or) .cs files are there,first i go to proerties->add exising item which file are add .cpp or .cs file
please explain clearly jsulm sir@Rameshguru What should I explain clearly? You should explain clearly the problem. For that I asked you to post the whole error messages instead of the numbers LNK2020 and LNK2001. Can you please do so?
And what do you want to add actually? Source code files or a library? For library @VRonin already explained how to do it.