-
[Ubuntu] C#) monodevelop로 다른 클래스를 참조(using) 하려면?OS/Linux 2020. 10. 29. 15:03
Monodevelop의 기본적인 사용방법은 아래 포스트를 참고해주세요.
https://stirringdev.tistory.com/11?category=903721
[ubuntu] 우분투에서 C# 컴파일 / Monodevelop
Monodevelop 라는 프로그램을 깔게 되면 cs 파일을 작성할 수 있게 된다. 이때, GUI체제가 꼭 필요한 것은 아니다. Monodevelop 설치방법 $ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-..
stirringdev.tistory.com
본문
mono에서 exe파일을 만들기위해 컴파일 할때 다른 클래스를 참조(using)하기 위해서는
ubuntu 명령어로 참조를 해주어야하는데
https://www.mono-project.com/docs/advanced/assemblies-and-the-gac/
Assemblies and the GAC | Mono
Assemblies and the GAC How Mono Finds Assemblies Application code is always split between many assemblies. In addition to an application’s own assembly, all Mono applications reference the mscorlib assembly, which contains the core class libraries of the r
www.mono-project.com
이와 같이 assemblies 와 GAC를 하는 방법이 있었다.
하지만 나는 위의 방법을 적용하지 못했다. (절망..)
계속 using 클래스 방법을 찾던 중
using할 클래스를 dll 파일로 컴파일한 후, 그 dll 파일에서 cs파일을 찾아 참조해야 쓸 수 있다는 사실을 알게 되었다.
Compile Using MONO - C# with Reference To A C# Library?
I have a C# library (DLL) // ProgramLib.cs // using System; namespace ProgramLibrary { public class Lib { public Lib() { Console.WriteLine("Lib Created"); ...
stackoverflow.com
위 사이트의 내용은 아래와 같다.
컴파일 명령어를 시도한 결과,
이 같은 메세지가 뜨면서 컴파일이 안되었고
gmcs 명령어가 안되는 이유는 mono의 버전차이라는 글을 본 기억이 나서
gmcs -> mcs라는 명령어로 변경하였더니 컴파일에 성공하게 되었다.
이렇게 만들어진 .dll 파일을 csc명령어로 컴파일할 때 참조파일(-r example.dll)로 불러주면 끝!!!
'OS > Linux' 카테고리의 다른 글
[Ubuntu] 32 bit 인지 64 bit 인지 확인하는 명령어 (0) 2021.01.16 [Ubuntu] 설정 (0) 2021.01.12 [Ubuntu] 파일 또는 디렉토리 삭제 명령어 (0) 2021.01.01 [Ubuntu] Unable to acquire the dpkg frontend lock (0) 2020.10.29 [Ubuntu] 우분투에서 C# 컴파일 / Monodevelop (0) 2020.10.29