Microsoft MVP성태의 닷넷 이야기
개발 환경 구성: 249. Visual Studio 2013에서 Mono 컴파일하는 방법 [링크 복사], [링크+제목 복사],
조회: 17485
글쓴 사람
정성태 (techsharer at outlook.com)
홈페이지
첨부 파일
 
(연관된 글이 1개 있습니다.)

Visual Studio 2013에서 Mono 컴파일하는 방법

모노(Mono) 프로젝트는 오픈 소스이기 때문에 다음의 경로에서 다운로드 받을 수 있습니다.

Mono open source ECMA CLI, C# and .NET implementation.
; https://github.com/mono/mono

압축을 푼 후 "\mono-master\msvc" 폴더에 가면 "mono.sln" 파일이 있습니다. 이것은 Visual Studio 2012용으로 맞춰져 있으므로 가장 좋은 것은 2012에서 로드하는 것이 좋습니다. 저는 2012가 없고 2013이 있는데, mono.sln을 Visual Studio 2013에서 로드하면 마이그레이션 여부를 묻는다는 차이만 있을 뿐 그대로 진행하면 됩니다.

만약, 마이그레이션을 하지 않고 진행하면 Visual Studio 2012가 설치되지 않은 경우 다음과 같은 컴파일 오류를 만나게 됩니다.

error MSB8020: The build tools for Visual Studio 2012 (Platform Toolset = 'v110') cannot be found. To build using the v110 build tools, please install Visual Studio 2012 build tools. Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Upgrade Solution...". C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Cpp.Platform.targets


그럼, Visual Studio 2012를 설치하든지, 아니면 다시 수작업으로 해당 프로젝트들을 모두 2013용 툴셋으로 업그레이드 해야 합니다. (솔루션 탐색기에서 마우스 우측 버튼으로 "Upgrade VC++ Projects..." 메뉴를 선택하면 됩니다.)

자, 이제 빌드하면 다른 프로젝트는 모두 잘 컴파일이 되지만 "monoposixhelper"만 다음과 같은 오류가 발생합니다.

error C1189: #error :  "Mono requires WinXP SP2 or later"   e:\mono\mono-master\config.h

웬일인지, monoposixhelper 프로젝트에서 _WIN32_WINNT 상수가 정의되지 않았는데요. 오류가 발생한 "e:\mono\mono-master\config.h" 파일을 열어,

#if _WIN32_WINNT < 0x0502
#error "Mono requires WinXP SP2 or later"
#endif /* _WIN32_WINNT < 0x0502 */

_WIN32_WINNT 상수를 억지로 넣어줘도 여전히 컴파일 오류가 발생합니다. 왜냐하면 config.h 파일은 monoposixhelper 프로젝트가 의존하고 있는 genmdesc 프로젝트, 다시 그 프로젝트가 의존하고 있는 libmonoutils 프로젝트의 "PreBuildEvent"에 설정된 winsetup.bat 파일로부터 자동 생성되기 때문입니다. /mono-master/msvc/winsetup.bat 파일의 내용을 보면,

@echo off
cd ..
copy winconfig.h config.h
goto end
:error
echo fatal error: the VSDepenancies directory was not found in the "mono" directory
echo error: you must download and unzip that file
exit /b 100
goto end
:ok
echo OK
:end
exit /b 0

결국 winconfig.h 헤더 파일이 복사되는 것 뿐인데요. 따라서 그 파일의 내용에 _WIN32_WINNT 상수를 추가해 주면 됩니다.

#define _WIN32_WINNT 0x0503

#if _WIN32_WINNT < 0x0502
#error "Mono requires WinXP SP2 or later"
#endif /* _WIN32_WINNT < 0x0502 */

그런 다음 monoposixhelper 프로젝트를 Rebuild 해주시면 정상적으로 빌드됩니다. 빌드 결과물은 "\mono-master\msvc" 폴더의 하위에 x86 용인 Win32를 타겟으로 한 빌드의 경우 Win32 폴더로, x64 빌드는 x64 폴더로 저장됩니다.

그래도, 여타의 다른 규모 있는 오픈 소스보다는 빌드가 꽤나 간단한 편에 속하는 군요. ^^




[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]

[연관 글]






[최초 등록일: ]
[최종 수정일: 7/10/2021]

Creative Commons License
이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-변경금지 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다.
by SeongTae Jeong, mailto:techsharer at outlook.com

비밀번호

댓글 작성자
 




1  2  3  [4]  5  6  7  8  9  10  11  12  13  14  15  ...
NoWriterDateCnt.TitleFile(s)
13540정성태1/29/20242113Linux: 69. 리눅스 - "Docker Desktop for Windows" Container 환경에서 IPv6 Loopback Address 바인딩 오류
13539정성태1/26/20242372개발 환경 구성: 703. Visual Studio - launchSettings.json을 이용한 HTTP/HTTPS 포트 바인딩
13538정성태1/25/20242427닷넷: 2211. C# - NonGC(FOH) 영역에 .NET 개체를 생성파일 다운로드1
13537정성태1/24/20242533닷넷: 2210. C# - Native 메모리에 .NET 개체를 생성파일 다운로드1
13536정성태1/23/20242603닷넷: 2209. .NET 8 - NonGC Heap / FOH (Frozen Object Heap) [1]
13535정성태1/22/20242482닷넷: 2208. C# - GCHandle 구조체의 메모리 분석
13534정성태1/21/20242260닷넷: 2207. C# - SQL Server DB를 bacpac으로 Export/Import파일 다운로드1
13533정성태1/18/20242488닷넷: 2206. C# - TCP KeepAlive의 서버 측 구현파일 다운로드1
13532정성태1/17/20242366닷넷: 2205. C# - SuperSimpleTcp 사용 시 주의할 점파일 다운로드1
13531정성태1/16/20242283닷넷: 2204. C# - TCP KeepAlive에 새로 추가된 Retry 옵션파일 다운로드1
13530정성태1/15/20242211닷넷: 2203. C# - Python과의 AES 암호화 연동파일 다운로드1
13529정성태1/15/20242093닷넷: 2202. C# - PublishAot의 glibc에 대한 정적 링킹하는 방법
13528정성태1/14/20242234Linux: 68. busybox 컨테이너에서 실행 가능한 C++, Go 프로그램 빌드
13527정성태1/14/20242156오류 유형: 892. Visual Studio - Failed to launch debug adapter. Additional information may be available in the output window.
13526정성태1/14/20242245닷넷: 2201. C# - Facebook 연동 / 사용자 탈퇴 처리 방법
13525정성태1/13/20242211오류 유형: 891. Visual Studio - Web Application을 실행하지 못하는 IISExpress
13524정성태1/12/20242299오류 유형: 890. 한국투자증권 KIS Developers OpenAPI - GW라우팅 중 오류가 발생했습니다.
13523정성태1/12/20242100오류 유형: 889. Visual Studio - error : A project with that name is already opened in the solution.
13522정성태1/11/20242242닷넷: 2200. C# - HttpClient.PostAsJsonAsync 호출 시 "Transfer-Encoding: chunked" 대신 "Content-Length" 헤더 처리
13521정성태1/11/20242304닷넷: 2199. C# - 한국투자증권 KIS Developers OpenAPI의 WebSocket Ping, Pong 처리
13520정성태1/10/20242073오류 유형: 888. C# - Unable to resolve service for type 'Microsoft.Extensions.ObjectPool.ObjectPool`....'
13519정성태1/10/20242132닷넷: 2198. C# - Reflection을 이용한 ClientWebSocket의 Ping 호출파일 다운로드1
13518정성태1/9/20242383닷넷: 2197. C# - ClientWebSocket의 Ping, Pong 처리
13517정성태1/8/20242219스크립트: 63. Python - 공개 패키지를 이용한 위성 이미지 생성 (pystac_client, odc.stac)
13516정성태1/7/20242342닷넷: 2196. IIS - AppPool의 "Disable Overlapped Recycle" 옵션의 부작용
13515정성태1/6/20242620닷넷: 2195. async 메서드 내에서 C# 7의 discard 구문 활용 사례 [1]
1  2  3  [4]  5  6  7  8  9  10  11  12  13  14  15  ...