Microsoft MVP성태의 닷넷 이야기
오류 유형: 912. Visual C++ - Linux 프로젝트 빌드 오류 [링크 복사], [링크+제목 복사],
조회: 5842
글쓴 사람
정성태 (seongtaejeong at gmail.com)
홈페이지
첨부 파일
 
(연관된 글이 1개 있습니다.)

Visual C++ - Linux 프로젝트 빌드 오류

리눅스 프로젝트를 빌드하는 경우 이렇게만 오류 메시지가 나온다면?

1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Application Type\Linux\1.0\Linux.WSL.targets(318,5): error : g++ exited with code 1, please see the Output Window - Build output for more details (NOTE: the build output verbosity might need to be changed in Tools Options to see more information in the Output Window).
1>Done building project "ConsoleApplication2.vcxproj" -- FAILED.


"Build And Run" 설정에 들어가 "MSBuild project build output verbosity" 항목을 "Normal"로 설정하고 재빌드를 합니다. 그럼 더 자세한 오류를 볼 수 있는데요,

1>------ Rebuild All started: Project: ConsoleApplication2, Configuration: Debug x64 ------
1>Build started 2024-07-03 오후 3:11:47.
1>Target _PrepareForClean:
...[생략]...
1>  Compiling sources:
1>  g++ -c -x c++ /home/testusr/projects/ConsoleApplication2/main.cpp -g2 -gdwarf-2 -o "/home/testusr/projects/ConsoleApplication2/obj/x64/Debug/main.o" -Wall -Wswitch -W"no-deprecated-declarations" -W"empty-body" -Wconversion -W"return-type" -Wparentheses -W"no-format" -Wuninitialized -W"unreachable-code" -W"unused-function" -W"unused-value" -W"unused-variable" -O0 -fno-strict-aliasing -fno-omit-frame-pointer -fthreadsafe-statics -fexceptions -frtti -std=c++11
1>  main.cpp
...[생략]...
1>  Done compiling '/home/testusr/projects/ConsoleApplication2/main.cpp'
1>  -bash: line 4: g++: command not found-bash: line 4: g++: command not found
1>Done building target "ClCompile" in project "ConsoleApplication2.vcxproj" -- FAILED.
1>
...[생략]...

저렇게 "g++: command not found-bash: line 4: g++: command not found" 메시지가 나옵니다. 그럼, 당연히 설치를 해야겠죠? ^^

sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get install build-essential gdb -y




혹은, Output 창을 자세히 보면 원격 리눅스 머신에서 실행하려던 명령어가 그대로 나오는데요, 가령, 위의 경우 g++ 실행을 다음과 같이 하는 중에 오류가 발생한 것입니다.

g++ -c -x c++ /home/testusr/projects/ConsoleApplication2/main.cpp -g2 -gdwarf-2 -o "/home/testusr/projects/ConsoleApplication2/obj/x64/Debug/main.o" -Wall -Wswitch -W"no-deprecated-declarations" -W"empty-body" -Wconversion -W"return-type" -Wparentheses -W"no-format" -Wuninitialized -W"unreachable-code" -W"unused-function" -W"unused-value" -W"unused-variable" -O0 -fno-strict-aliasing -fno-omit-frame-pointer -fthreadsafe-statics -fexceptions -frtti -std=c++11


이걸 그대로 복사해 대상 리눅스 머신에서 직접 실행해 보면, 오류 메시지가 출력될 것이고 그에 따른 조치를 취해주시면 됩니다. ^^




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

[연관 글]






[최초 등록일: ]
[최종 수정일: 7/3/2024]

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)
13862정성태1/13/20251576Linux: 112. Linux - 데몬을 위한 SELinux 보안 정책 설정
13861정성태1/11/20251968Windows: 276. 명령행에서 원격 서비스를 동기/비동기로 시작/중지
13860정성태1/10/20251845디버깅 기술: 216. WinDbg - 2가지 유형의 식 평가 방법(MASM, C++)
13859정성태1/9/20251941디버깅 기술: 215. Windbg - syscall 이후 실행되는 KiSystemCall64 함수 및 SSDT 디버깅
13858정성태1/8/20251957개발 환경 구성: 738. PowerShell - 원격 호출 시 "powershell.exe"가 아닌 "pwsh.exe" 환경으로 명령어를 실행하는 방법
13857정성태1/7/20251965C/C++: 187. Golang - 콘솔 응용 프로그램을 Linux 데몬 서비스를 지원하도록 변경파일 다운로드1
13856정성태1/6/20252092디버깅 기술: 214. Windbg - syscall 단계까지의 Win32 API 호출 (예: Sleep)
13855정성태12/28/20242362오류 유형: 941. Golang - os.StartProcess() 사용 시 오류 정리
13854정성태12/27/20242634C/C++: 186. Golang - 콘솔 응용 프로그램을 NT 서비스를 지원하도록 변경파일 다운로드1
13853정성태12/26/20242474디버깅 기술: 213. Windbg - swapgs 명령어와 (Ring 0 커널 모드의) FS, GS Segment 레지스터
13852정성태12/25/20242360디버깅 기술: 212. Windbg - (Ring 3 사용자 모드의) FS, GS Segment 레지스터파일 다운로드1
13851정성태12/23/20242324디버깅 기술: 211. Windbg - 커널 모드 디버깅 상태에서 사용자 프로그램을 디버깅하는 방법
13850정성태12/23/20242387오류 유형: 940. "Application Information" 서비스를 중지한 경우, "This file does not have an app associated with it for performing this action."
13849정성태12/20/20242549디버깅 기술: 210. Windbg - 논리(가상) 주소를 Segmentation을 거쳐 선형 주소로 변경
13848정성태12/18/20242596디버깅 기술: 209. Windbg로 알아보는 Prototype PTE파일 다운로드2
13847정성태12/18/20242646오류 유형: 939. golang - 빌드 시 "unknown directive: toolchain" 오류 빌드 시 이런 오류가 발생한다면?
13846정성태12/17/20242854디버깅 기술: 208. Windbg로 알아보는 Trans/Soft PTE와 2가지 Page Fault 유형파일 다운로드1
13845정성태12/16/20243117디버깅 기술: 207. Windbg로 알아보는 PTE (_MMPTE)
13844정성태12/14/20242892디버깅 기술: 206. Windbg로 알아보는 PFN (_MMPFN)파일 다운로드1
13843정성태12/13/20242853오류 유형: 938. Docker container 내에서 빌드 시 error MSB3021: Unable to copy file "..." to "...". Access to the path '...' is denied.
13842정성태12/12/20243055디버깅 기술: 205. Windbg - KPCR, KPRCB
13841정성태12/11/20243165오류 유형: 937. error MSB4044: The "ValidateValidArchitecture" task was not given a value for the required parameter "RemoteTarget"
13840정성태12/11/20243019오류 유형: 936. msbuild - Your project file doesn't list 'win' as a "RuntimeIdentifier"
13839정성태12/11/20242961오류 유형: 936. msbuild - error CS1617: Invalid option '12.0' for /langversion. Use '/langversion:?' to list supported values.
13838정성태12/4/20242929오류 유형: 935. Windbg - Breakpoint 0's offset expression evaluation failed.
13837정성태12/3/20243104디버깅 기술: 204. Windbg - 윈도우 핸들 테이블 (3) - Windows 10 이상인 경우
1  [2]  3  4  5  6  7  8  9  10  11  12  13  14  15  ...