문제

I have a project in c# which uses bindings to use some c++ code. The c++ code consists of multiple DLL's which are compiled using a makefile. Currently I'm trying to run the makefile using a pre build event which calls nmake. However to get it to find nmake I need to have a line in it like the following:

"$(DevEnvDir)..\..\VC\vcvarsall.bat"

Also, even with that line present, nmake doesn't produce any output at all in the output window. Neither does it throw any errors. I tried redirecting the output to a file and it doesn't write anything. I have reproduced all steps in my pre build event in a normal shell and it works fine. I figure I must be missing something. Why doesn't Visual Studio give me a Visual Studio shell for my pre build event? Is there a better way to run this makefile? If not, has anyone got any ideas as to why nmake isn't producing any output?

EDIT: D'oh! nmake wasn't running as I forgot to add 'call' to the start of the line, i.e:

call "$(DevEnvDir)..\..\VC\vcvarsall.bat"
도움이 되었습니까?

해결책

I often build non VS-project (sometimes with nmake, sometimes with other build tools) as a part of a larger solution build.

I tend to make a simple batch file, which sets up the environment and then runs the make.

I call the batch file from a build event (often post-build on my stuff) - usually with a CD on the front:

cd ..\.. && armbuild

Never (that I can remember, anyway) had any problem with the output appearing in the console window.

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