본문 바로가기
VisualStudio.C++.C#

Visual C++. 사용자 정의 매크로 만들기. Include Directories, Library Directories

by i.got.it 2020. 9. 15.

 

 

VS 2019 . 

Property Manager 창 열기  

 

메뉴 : View -> Other Windows -> Property Manager 클릭 

 

 

 

  1. Open the Property Manager window. (On the menu bar, choose View > Property Manager or View > Other Windows > Property Manager.) Open the shortcut menu for a property sheet (its name ends in .user) and then choose Properties. The Property Pages dialog box for that property sheet opens.
  2. In the left pane of the dialog box, select User Macros. In the right pane, choose the Add Macro button to open the Add User Macro dialog box.
  3. In the dialog box, specify a name and value for the macro. Optionally, select the Set this macro as an environment variable in the build environment check box.

 

 

 

위의 예와 같이 사용자 정의 macro 추가해두면  프로젝트 설정에서 Include Directory 에 경로 기록시 $(CySDK_CPP_PATH) 를 기록한다. 

 

 

모든 프로젝트에서 공통 적용되는 Include Directory 설정법 

- 위 설정창의 User Macros 아래에 보이는 VC++Directory 의   Include Directories 에 경로 기록한 이후 생성되는 VC++ 모든 프로젝트에 공통 적용되므로 프로젝트마다 개별적으로 헤더파일 인클루트 경로 지정하지 않아도 되므로 매우 편리함. 

 

모든 프로젝트에서 공통 적용되는 Library Directory 설정법 

- 위 설정창의 User Macros 아래에 보이는 VC++Directory 의   Library Directories 에 경로 기록한 이후 생성되는 VC++ 모든 프로젝트에 공통 적용된다. 

Library Directory 지정  용도 :  아래 구문처럼 lib 파일 경로 지정할 때 베이스 경로 지정하는 용도.  

 

#pragma comment(lib,"CyS2_CyFinBotFile/x64/Release/CyS2LE1_CyFinBotFile.LIB" )

 

 

 

 

 

 

 

 

 

from : docs.microsoft.com/ko-kr/cpp/build/working-with-project-properties?view=vs-2019

 

Visual Studio에서 C++ 컴파일러 및 빌드 속성 설정

Visual Studio IDE를 사용하여 C++ 컴파일러 및 링커 옵션과 기타 빌드 설정을 변경합니다.

docs.microsoft.com

 

 

 

 

2024.03.16 추가 

 

VS 2022 에서는 앞의 설명과 같은 전역 매크로 설정 안되며, 프로젝트 단위로 매크로 설정가능. 

 

https://learn.microsoft.com/ko-kr/cpp/build/create-reusable-property-configurations?view=msvc-170

 

Visual Studio 프로젝트 설정 공유 또는 재사용 - C++

자세한 정보: Visual Studio 프로젝트 설정 공유 또는 재사용

learn.microsoft.com

 

 

 


첫 등록 : 2020.09.15

최종 수정 : 2024.03.16

단축 주소 : https://igotit.tistory.com/2593

 


 

댓글



 

비트코인




암호화폐       외환/나스닥/골드       암호화폐/외환/나스닥/골드 암호화폐/외환/나스닥/골드   암호화폐/외환/나스닥/골드
     
현물 |선물 인버스 |선물 USDT       전략매니저(카피트레이딩)     롤오버 이자 없는 스왑프리계좌
( 스왑프리 암호화폐도 거래 가능 )    
MT4, MT5 , cTrader 모두 지원     FTMO 계좌 매매운용. MT4,MT5