473,586 Members | 2,695 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

#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\includ e\stddef.h(28) : error C2144: syntax error : 'int' should
be preceded by ';'
C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\includ e\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 10968
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<SomeName space::ManagedC lass *> myManagedClassP ;
boost::shared_p tr< 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*********@ho tmail.com> wrote in message
news:%2******** ********@TK2MSF TNGP11.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\includ e\stddef.h(28) : error C2144: syntax error : 'int' should
be preceded by ';'
C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\includ e\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
3206
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 writing one object in C# which will take the entire table tag contents and renders. Ie., we need to pass "<table>………… <thead>……</thead>. <tr>.<td>...
2
10553
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 type="text/javascript"> <!]> </script> <script type="text/javascript"
18
2617
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> Assume that this library will be used by other groups. I think the answer
9
13097
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 am curious how compiler find it.
2
1861
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
4572
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 internal chars of a System::String object. I came across it by reading Peter Grimes's "Managed Extensions for Visual C++.NET" published by MSPress. ...
2
4283
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 include file 'dArray.h' 'Unable to open include file'dArray.cp'
3
3362
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, &gt ,&ltCompany&gt to display '<', '>' and '<Company>' respectively. But is there any freeware code available which could implement the above...
14
3132
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 PHP interpreter works like any other, that is, it first expands all the include files, and then parses the resulting text. Can anyone help with an...
0
7836
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8199
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8336
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7950
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8212
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5710
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3835
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2343
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1447
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.