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

Really basic MC++ compilation error

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) Clear the new C++ file and replace with the two 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

What do I do? I want to use the gcroot class. Has anyone done so
successfully?

I must say, that so far, converting to Managed C++ has been very
problematic and difficult:
1) Can't use a dynamically linked MFC/runtime
2) Hence I can't use many third party DLLs, namely Boost which VS 2003
has such widely touted compatibility with.
3) Many obscure, confusing, and difficult to diagnose compilation/link
errors.
Nov 17 '05 #1
2 2793
Hi,

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:u8**************@tk2msftngp13.phx.gbl...
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) Clear the new C++ file and replace with the two 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

What do I do? I want to use the gcroot class. Has anyone done so
successfully?

I must say, that so far, converting to Managed C++ has been very
problematic and difficult:
1) Can't use a dynamically linked MFC/runtime
2) Hence I can't use many third party DLLs, namely Boost which VS 2003
has such widely touted compatibility with.
3) Many obscure, confusing, and difficult to diagnose compilation/link
errors.

Nov 17 '05 #2
Thank you for the reply! That code you posted doesn't compile with the
same error that I specified.

I already posted some really simple code:
#include "stdafx.h"
#include <vcclr.h>

The mere act of including <vcclr.h> causes compilation errors. This is
with all default settings; in my original post I listed step by step
instructions of creating a new project, etc.

Steve McLellan wrote:
Hi,

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

Nov 17 '05 #3

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

Similar topics

5
by: K. Shier | last post by:
when attempting to edit code in a class file, i see the bug "Visual Basic ..NET compiler is unable to recover from the following error: System Error &Hc0000005&(Visual Basic internal compiler...
0
by: Daniel Lidström | last post by:
Hi, I've been trying a long time now to generate some XML using MC++ and XmlSerializer. I have a piece of C# code that produces exactly what I want, but I simply can't get the MC++ code to write...
0
by: Jim Haynes | last post by:
Our Visual Basic application requires precision mathmatical operation in order to converge to a solution (QR algorithim to extract eigenvalues and eigenvectors). Out test case is one that is rather...
1
by: Alexander Arlievsky | last post by:
Hi, I have MC++ mixed mode assembly, which also uses MFC. Everything works fine, but C# code, which uses this MC++ assembly sees all MFC symbols as members of the global namespace. When I open...
8
by: Ted Miller | last post by:
Hi folks, I'm looking at moving a large base of C++ code to .Net under tight time constraints. The code runs in mission-critical environments, and I am extremely concerned about the loader lock...
2
by: Edward Diener | last post by:
In C++ an overridden virtual function in a derived class must have the exact same signature of the function which is overridden in the base class, except for the return type which may return a...
8
by: Chris | last post by:
Hi, All my websites and webservices are down. I get the following message Server Error in '/mywebservices' Application....
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...
2
by: dave | last post by:
Hi, I wrote a classlibrary in vs 2005 mc++ and declered inside it a struct like this: public ref struct FGBITParam { public: FGBITParam()
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
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.