K
Kalafiorczyk
Ladies and Gentlemen of Microsoft!
I'm having a small problem that I hope to be able to
solve without having to burn a support call included
with MSDN.
I have a short "Hello, world!" app that is 100%
portable between Standard C++ and Managed C++.
I can build it with VS7.1 using command line.
But I cannot reproduce my results in the IDE.
Could any kind soul post here or e-mail me a
working .vcproj that has two configurations
(1) normal "debug" and (2) pure managed (not
just managed)?
Again, I'm not asking how to build managed code
that works. I'm asking how to build pure managed
C++ code that passes peverify check. It should
be then both secure and platform independent.
My e-mail address in the headers is easy to fix.
My project is really simple so I include it all here.
It has two .cmd files: to build unmanaged and pure
managed, and single source file.
Thanks for reading,
Sylvester
-------------------------------------------------------
@cl /Od h.cpp /Fohu /Fehu /link /opt:ref
-------------------------------------------------------
@echo off
cl /clr:initialAppDomain /Od h.cpp /Fohm /Fehm nochkclr.obj /link /entry:main /fixed:no /opt:ref
if errorlevel 1 exit
rem permview hm.exe
silo -s hm.exe
peverify hm.exe
-------------------------------------------------------
#ifdef _MANAGED
#using <mscorlib.dll>
using namespace System::Security:ermissions;
[assembly:SecurityPermissionAttribute(
SecurityAction::RequestMinimum,SkipVerification=false)];
#define puts System::Console::WriteLine
#define S(x) S##x
#else
#include <cstdio>
#define S(x) x
#endif
int main() {
puts(S("Hello, C++ world!"));
return 0;
}
---------------------------------------------------------
I'm having a small problem that I hope to be able to
solve without having to burn a support call included
with MSDN.
I have a short "Hello, world!" app that is 100%
portable between Standard C++ and Managed C++.
I can build it with VS7.1 using command line.
But I cannot reproduce my results in the IDE.
Could any kind soul post here or e-mail me a
working .vcproj that has two configurations
(1) normal "debug" and (2) pure managed (not
just managed)?
Again, I'm not asking how to build managed code
that works. I'm asking how to build pure managed
C++ code that passes peverify check. It should
be then both secure and platform independent.
My e-mail address in the headers is easy to fix.
My project is really simple so I include it all here.
It has two .cmd files: to build unmanaged and pure
managed, and single source file.
Thanks for reading,
Sylvester
-------------------------------------------------------
@cl /Od h.cpp /Fohu /Fehu /link /opt:ref
-------------------------------------------------------
@echo off
cl /clr:initialAppDomain /Od h.cpp /Fohm /Fehm nochkclr.obj /link /entry:main /fixed:no /opt:ref
if errorlevel 1 exit
rem permview hm.exe
silo -s hm.exe
peverify hm.exe
-------------------------------------------------------
#ifdef _MANAGED
#using <mscorlib.dll>
using namespace System::Security:ermissions;
[assembly:SecurityPermissionAttribute(
SecurityAction::RequestMinimum,SkipVerification=false)];
#define puts System::Console::WriteLine
#define S(x) S##x
#else
#include <cstdio>
#define S(x) x
#endif
int main() {
puts(S("Hello, C++ world!"));
return 0;
}
---------------------------------------------------------