【发布时间】:2010-11-15 00:51:22
【问题描述】:
请帮帮我~:)
在 Visual Studio 上编译成功。但是,Under code 无法在 linux、g++ 上编译。
代码..
啊.h
struct Test { Test(); ~Test(); };
B.h
extern struct Test { Test(); ~Test(); };
A.cpp
#include "A.h"
Test::Test()
{
cout << "Construction" << endl;
}
Test::~Test()
{
cout << "Destruction" << endl;
}
B.cpp
#include "B.h"
strcut A_Test : Test { A_Test(); ~A_Test(); };
当我在 linux 上编译代码时。我在描述中遇到错误。
"只能为对象和函数指定存储类"
这段代码在linux上有什么问题?
谢谢大家,请理解我愚蠢的英语。
【问题讨论】: