C++ 命名空间问题
在VS2005中,添加一个类库项目 f0122,代码是
另外在新建一个Win32控制台应用程序,想在控制台应用程序里调用新建类库的类
但是在引用命名空间时出错(既上面代码第五行出错),请问怎么解决?
PS:我在Win32控制台应用程序已经添加了对f0122的引用。
// f0122.h
#pragma once
#include "stdafx.h"
using namespace System;
using namespace std;
namespace f0122 {
class myTestClass{
int _id ;
string _name;
public:
myTestClass(int id,string str);
~myTestClass(){}
int getId();
string getName();
void setId(int id);
void setName(string name);
};
}
另外在新建一个Win32控制台应用程序,想在控制台应用程序里调用新建类库的类
#include <iostream>
#include <string>
#include <Windows.h>
using namespace std;
using namespace f0122;
但是在引用命名空间时出错(既上面代码第五行出错),请问怎么解决?
PS:我在Win32控制台应用程序已经添加了对f0122的引用。
...全文


