문제

I have a batch file with this code:

@echo off
set VAR=7
echo the version is %VAR%

I want to add this .bat file to my visual studio project, using pre-build event. I wrote in the pre build event the path to the batch file, but then when I enter the : Resources ->PreProcessor definitions - I can't see the VAR How can I add it? any help would be appreciated!!

도움이 되었습니까?

해결책

Change your BAT script to be something like

echo #define VER 7 > version.h

and then have your code use

#include "version.h"
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top