본문 바로가기

프로그래밍

notepad++ 에서 코드 테스트하기

노트패드++ 에서 간단한 C++ 코드 테스트해보기.


nppexec 플러그인 설치후 F6눌러서 나오는곳에 아래 환경설정 내용입력.

컴파일시 에러나는것 검출해서 실행 막는부분은 추후에 찾아보자.


nppexec 플러그인 환경설정.

NPP_SAVE

// run@.cpp.txt

// setting NppExec's internal (user) variables

SET VCBASE=C:\Program Files (x86)\Microsoft Visual Studio 12.0

SET VCDIR = $(VCBASE)\VC

SET VSCOMMON = $(VCBASE)\Common7\IDE

SET MSSDK = C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A

// saving previous values of environment variables (just in case)

SET PATH_0 = $(SYS.PATH)

SET INCLUDE_0 = $(SYS.INCLUDE)

SET LIB_0 = $(SYS.LIB)

// setting NppExec's child process'es environment variables

ENV_SET PATH = $(VCDIR)\bin;$(MSSDK)\bin;$(VSCOMMON);$(SYS.PATH)

ENV_SET INCLUDE = $(MSSDK)\include;$(VCDIR)\include;$(SYS.INCLUDE)

ENV_SET LIB = $(MSSDK)\lib;$(VCDIR)\lib;$(SYS.LIB)

// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

///! NOTE: change the following to the folder where your clang binary resides

SET clangc = $(VCDIR)\bin\cl.exe

// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

SET obj = $(CURRENT_DIRECTORY)\$(NAME_PART)

// run clang

"$(clangc)" "$(FULL_CURRENT_PATH)" -o "$(obj).exe"

cmd /c "$(obj).exe"

UNSET obj

UNSET clangc

// restoring previous values of environment variables

ENV_SET PATH = $(PATH_0)

ENV_SET INCLUDE = $(INCLUDE_0)

ENV_SET LIB = $(LIB_0)

UNSET VCBASE