473,405 Members | 2,415 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,405 software developers and data experts.

#include <vcclr.h>

I'm new to Managed C++ development, and I can't seem to get started.
Every time I try to include vcclr.h I get bizarre compilation errors.
I've isolated this to a really simple case:

In Visual Studio .NET 2003, I do the following
1) File->New->Project
2) Visual C++ Projects->.NET->Windows Forms Application
3) Project->Add New Item->C++ File
4) Replace the contents of the new C++ file with the simple lines:
#include "stdafx.h"
#include <vcclr.h>
5) Build->Build Solution

I get the following compilation errors:
C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\stddef.h(28) : error C2144: syntax error : 'int' should
be preceded by ';'
C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\stddef.h(28) : error C2501: 'p' : missing storage-class
or type specifiers
Any help is greatly appreciated.

(Sorry for the repost; but I didn't get a response to my earlier post so
I'm trying to reword and clarify)
Nov 17 '05 #1
2 10929
I think you need to include mscorlib.dll before you can include vcclr.h. mscorlib.dll is the main include file for MC++. I think vcclr.h is just some useful utilities. Try the following

#using <mscorlib.dll
#include <vcclr.h>
Nov 17 '05 #2
Hi,

Follows is the response to your earlier message that I posted :-)

I'm using vcclr.h without any probs. I'm also compiling Boost under a mixed
compilation without any problems.

The following should be OK, for example:

#pragma once
#include <vcclr.h>
#include <boost/shared_ptr.hpp>

namespace SomeNamespace
{
__gc class ManagedClass;
}

class UnmanagedClass
{
public:
gcroot<SomeNamespace::ManagedClass *> myManagedClassP;
boost::shared_ptr< int > myBoostP;
}

As for obscure compiling and linking errors, I've had a few but they've
generally been solvable. Hope this helps a bit, if it doesn't, try posting a
bit of example code that doesn't work.

Steve


"Tommy Vercetti" <ve*********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
I'm new to Managed C++ development, and I can't seem to get started.
Every time I try to include vcclr.h I get bizarre compilation errors.
I've isolated this to a really simple case:

In Visual Studio .NET 2003, I do the following
1) File->New->Project
2) Visual C++ Projects->.NET->Windows Forms Application
3) Project->Add New Item->C++ File
4) Replace the contents of the new C++ file with the simple lines:
#include "stdafx.h"
#include <vcclr.h>
5) Build->Build Solution

I get the following compilation errors:
C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\stddef.h(28) : error C2144: syntax error : 'int' should
be preceded by ';'
C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\stddef.h(28) : error C2501: 'p' : missing storage-class
or type specifiers
Any help is greatly appreciated.

(Sorry for the repost; but I didn't get a response to my earlier post so
I'm trying to reword and clarify)

Nov 17 '05 #3

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

Similar topics

2
by: Eshrath | last post by:
Hi, What I am trying to do: ======================= I need to form a table in html using the xsl but the table that is formed is quite long and cannot be viewed in our application. So we are...
2
by: Donald Firesmith | last post by:
I am having trouble having Google Adsense code stored in XSL converted properly into HTML. The <> unfortunately become &lt; and &gt; and then no longer work. XSL code is: <script...
18
by: Tuckers | last post by:
My question is, if I have created my own library which lives in its own install directory, to refer to its header file is it better to use #include "MyLibrary.h" or #include <MyLibrary.h> ...
9
by: bill | last post by:
Forget the exact definition of difference between, #include <foo.h> and #include "bar.h" Normally foo.h is a standard header file, so it's path is not defined in compiler option, but I...
2
by: Martin Hvidberg | last post by:
Dear list I have found a declaration like this: #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #include <math.h> #include "ectemp.h"
2
by: Eric Twietmeyer | last post by:
In the header file vcclr.h (in the .../Vc7/include directory of your installation) there is an inlined function PtrToStringChars defined. This is a utility function to get quick access to the...
2
by: Jofio | last post by:
I have 3 files, namely: dArray.h dArray.cp TestdArray.cpp Problem is when I compile the 'main' program - TestdArray.cpp - , it (the compiller) produces the following error: 'Unable to open...
3
by: ajay2552 | last post by:
Hi, I have a query. All html tags start with < and end with >. Suppose i want to display either '<' or '>' or say some text like '<Company>' in html how do i do it? One method is to use &lt,...
14
by: Michael | last post by:
Since the include function is called from within a PHP script, why does the included file have to identify itself as a PHP again by enclosing its code in <?php... <?> One would assume that the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.