473,320 Members | 1,572 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

compiling (native) C++ under VC7

I am writing a communications library which makes extensive use of the
STL and templates in general. I am using VC7 to compile because of
alledged better support for templates etc.

However, I have not been able to get a simple question answered. Will my
C++ code be compiled to IL? (I hope not). Is there anyway in the project
settings etc that I can ensure that the binary produced during
compilation is a native binary, i.e. NOT IL code which can be so easily
disassembled, and requires a VM (yuk!)

Question is, how I can be sure that I am producing native binaries
instead of Il (without having to resort to using a dissasembler et, etc.) ?

If I am not convinced that VC7 is really generating native binaries, is
there anyway I can use STL (loki code etc) from VC6?
Mar 12 '06 #1
2 1203
Hi Bart!
However, I have not been able to get a simple question answered. Will my
C++ code be compiled to IL? (I hope not).
If you want IL-Code you must "explicit" tell the compiler to do so
(option "/clr"; "use managed extensions" in the "general" tab).
If you have not set this option in your project setting, then the output
will be native.
You can verify this by checking the _MANAGED macro:

#ifdef _MANAGED
#error "This app must be compiled as native code!"
#endif
Is there anyway in the project
settings etc that I can ensure that the binary produced during
compilation is a native binary, i.e. NOT IL code which can be so easily
disassembled, and requires a VM (yuk!)
As I said (see above).
Question is, how I can be sure that I am producing native binaries
instead of Il (without having to resort to using a dissasembler et, etc.) ?
#ifdef _MANAGED
#error "This app must be compiled as native code!"
#endif

If I am not convinced that VC7 is really generating native binaries, is
there anyway I can use STL (loki code etc) from VC6?


I suggest you should upgrate to VC2005, because the new compiler is more
standard conform than VC7...

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/
Mar 12 '06 #2
"Bart Simpson" <ea*********@springfield.com> wrote in message
news:dv**********@nwrdmz02.dmz.ncs.ea.ibs-infra.bt.com
I am writing a communications library which makes extensive use of the
STL and templates in general. I am using VC7 to compile because of
alledged better support for templates etc.

However, I have not been able to get a simple question answered. Will
my C++ code be compiled to IL? (I hope not).
Not unless you specifically ask for it.
If I am not convinced that VC7 is really generating native binaries,
Build a simple "Hello, world!" console app, run it on a machine without
..NET installed. If this does not convince you, I don't know what will.

Try to open the executable in MSIL Disassembler (ILDASM) tool. If it
opens, it's a .NET assembly. If there's an error, it's a native
executable.
is there anyway I can use STL (loki code etc) from VC6?


This question does not make any sense to me. STL is almost completely
implemented in header files. Wherever you take it from, it's in source
code form and gets compiled by whatever compiler you are building the
project with. If you don't trust said compiler, I'm not sure how getting
STL headers from elsewhere would help.

Loki is a template library completely unrelated to STL. It's also
distributed in source form, so the same argument applies. Besides, Loki
does not compile on VC6 so it's not clear what you mean by "loki code
from VC6".
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
Mar 12 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Aliencat | last post by:
I'm having issues compiling php v4.2.2 on Redhat 9.0. The goal ultimately is to compile in mcrypt support, but that's a bit down the road from here. I've chased down the dependencies for the...
4
by: Fred Mailhot | last post by:
Hi... Is there any way to do this for *nix ?? Pointers to resources and/or FAQS would be much appreciated. Thanks, Fred.
0
by: Johnathan Doe | last post by:
I've been thinking about what the issues would be in compiling Python into native machine code, and since type information is important in Python, it seems possible that Python code can be...
6
by: Martin Bless | last post by:
The good news: Along with Python-2.4 comes really good news to Windows users. Yes, you now CAN build extension modules yourself using the SAME C++ compiler and linker Python is built with...
1
by: bob | last post by:
Is it possible to compile dot net programs to a standalone native windows exe (without requiring dot net framework runtime)? If so, is it then possible to distribute exe's with only required dotnet...
1
by: Omid Hodjati | last post by:
Hi All, I have an old unmanaged code written in C++ 6.0. This is a time critcal, CPU bound application. I have deciede migrate this application to managed world and VC++ 7.0. The first step was...
4
by: Aaron Queenan | last post by:
When I build a C++ library to .NET using the managed C++ compiler, I get the following error message: Linking... LINK : error LNK2020: unresolved token (0A000005) _CrtDbgReport LINK : error...
5
by: dovgani | last post by:
I have an unmanaged MFC project. The output is static lib. I would like to compile using /clr option. The native lib size is 64 megs and with /clr and /O1 options is 940 megs. Is it possibly...
8
by: WebSnozz | last post by:
I have an application written in C that does a lot of low level stuff. It does a lot of things like casting from void*'s. I want to create a new GUI for it in either C# or MC++, but reuse the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.