« Fixing MonoDevelop’s translation functions | Home | Patch for phpGladeTool »
Linking a shared assembly in the Mono C# compiler
By admin | December 23, 2008
If you wrote a class in C++ and wanted to use it in many applications, you could simple #include it in each application you wanted to use it in. But if you wrote a class in C# and wanted to use it in many applications, you cannot just #include it, because there is no #include in the C# language! The solution to this is to reference the library. This article will show you in easy steps:
- After you have written the class, compile it into a library with “gmcs ClassXyz.cs -target:library” (replace ClassXyz.cs with your class’s filename)
- The command above should generate a shared library/assembly called ClassXyz.dll.
- Now you can compile the application with “gmcs ProgramXyz.cs -reference:ClassXyz.dll”.
If you found this article useful or helpful, please help Compdigitec spread the word. Don’t forget to subscribe to Compdigitec Labs for more useful and interesting articles!
If you found this article helpful or interesting, please help Compdigitec spread the word. Don’t forget to subscribe to Compdigitec Labs for more useful and interesting articles!
Topics: Linux | 11 Comments »
August 11th, 2024 at 18:31
… [Trackback]
[…] Find More on that Topic: compdigitec.com/labs/2008/12/23/linking-a-shared-assembly-in-the-mono-c-compiler/ […]
August 16th, 2024 at 20:04
… [Trackback]
[…] Find More on on that Topic: compdigitec.com/labs/2008/12/23/linking-a-shared-assembly-in-the-mono-c-compiler/ […]
September 16th, 2024 at 20:09
… [Trackback]
[…] Find More on on that Topic: compdigitec.com/labs/2008/12/23/linking-a-shared-assembly-in-the-mono-c-compiler/ […]
September 20th, 2024 at 19:42
… [Trackback]
[…] Find More on that Topic: compdigitec.com/labs/2008/12/23/linking-a-shared-assembly-in-the-mono-c-compiler/ […]
September 24th, 2024 at 12:41
… [Trackback]
[…] Read More on to that Topic: compdigitec.com/labs/2008/12/23/linking-a-shared-assembly-in-the-mono-c-compiler/ […]
September 25th, 2024 at 02:46
… [Trackback]
[…] Read More to that Topic: compdigitec.com/labs/2008/12/23/linking-a-shared-assembly-in-the-mono-c-compiler/ […]
September 29th, 2024 at 15:40
… [Trackback]
[…] Read More on on that Topic: compdigitec.com/labs/2008/12/23/linking-a-shared-assembly-in-the-mono-c-compiler/ […]
October 15th, 2024 at 14:39
… [Trackback]
[…] Find More here on that Topic: compdigitec.com/labs/2008/12/23/linking-a-shared-assembly-in-the-mono-c-compiler/ […]
October 20th, 2024 at 02:09
… [Trackback]
[…] Here you can find 86801 additional Information to that Topic: compdigitec.com/labs/2008/12/23/linking-a-shared-assembly-in-the-mono-c-compiler/ […]
October 26th, 2024 at 08:03
… [Trackback]
[…] Here you will find 46536 additional Information to that Topic: compdigitec.com/labs/2008/12/23/linking-a-shared-assembly-in-the-mono-c-compiler/ […]
October 28th, 2024 at 21:54
… [Trackback]
[…] Read More Information here on that Topic: compdigitec.com/labs/2008/12/23/linking-a-shared-assembly-in-the-mono-c-compiler/ […]