|
||||||
| Managed C++ Visual Studio .NET managed C++ Topics |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
After compilation this simple example code, I have irritating error... I don't know what's going on, can anybody help me to solve that?
File Form1.h Code:
#ifndef __FORM1_H__
#define __FORM1_H__
#include "TClass.h"
namespace testmycpp
{
public ref class Form1
{
public:
Form1(void);
private:
TClass ^m_tc; //this declaracion cause error
};
}
#endif
Code:
#include "stdafx.h"
#include "Form1.h"
using namespace testmycpp;
Form1::Form1()
{
}
Code:
#ifndef __TCLASS_H__
#define __TCLASS_H__
namespace testmycpp
{
public ref class TClass
{
public:
TClass(void);
};
}
#endif
Code:
#include "stdafx.h"
#include "TClass.h"
using namespace testmycpp;
TClass::TClass()
{
}
Code:
#pragma once Error 1 error C2143: syntax error : missing ';' before '^' Error 2 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int Error 3 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int |
| Sponsored Links |
|
|
|
|||||
|
I think you are calling that tclass wrong. It should be:
Code:
testmycpp::TClass ^m_tc; //Try this
__________________
Lop |
|
|||
|
Whenever you declare a variable of a type that is specified in a namespace such as System or std, you need to put that namespace in front of it like so:
namespace_name::variable_type |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| VB6.0:Tutorial, Error handling | TcM | VB Tutorials | 9 | 06-06-2008 02:31 PM |
| Compilation Error | Victor | Java Help | 6 | 10-05-2007 09:56 AM |
| need urgent help finding parce error!!! | siren | C and C++ | 3 | 09-13-2007 10:45 AM |
| Download problem, internal Server Error | j3cubcapt | ionFiles | 1 | 07-02-2007 10:45 AM |
| can someone help me with my c librarys? | bobwrit | C and C++ | 4 | 04-27-2007 07:19 PM |
| WingedPanther | ........ | 2753.6 |
| Xav | ........ | 2704 |
| Brandon W | ........ | 1702.32 |
| John | ........ | 1207.73 |
| marwex89 | ........ | 1175.24 |
| morefood2001 | ........ | 966.05 |
| dcs | ........ | 655.75 |
| Steve.L | ........ | 475.59 |
| orjan | ........ | 418.58 |
| Aereshaa | ........ | 383.54 |