作者Mewra ()
看板C_and_CPP
标题[问题] 请问宣告顺序问题
时间Mon May 25 21:21:49 2009
Hi, 有个问题想请问
现在有两个档, A跟B档, B档是被A档include
现在有一个class叫test, 因为这个class本身设计有问题, 只能存在A档里.
但是在B档内要能用到在A档内宣告的test变数, 并instance它.
A档 :
#include <test.h>
#include <B.h>
int main()
{
test* mq;
..........
}
B档 :
void ...()
{
mq = new test( "ooxx" );
}
请问这该怎麽办~?
这个有问题的class是boost library的message_queue, 刚好遇到这问题时看到
有人发了同样问题的bug ticket.
请问除了boost library的message_queue外, 有其它在windows跟linux上较常用
的message_queue library吗?
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 59.189.92.252
1F:推 plover:copy/paste A档 XD 05/25 22:43
2F:→ Mewra:没办法~因为B其实在A上面好几层 只是这边用两层来示意 05/26 00:21
3F:推 jerohands:写个.h例stdafx.h,把所有会用到的.h .lib通通放在里面 05/26 01:05
4F:→ jerohands:每个.cpp第一个先include stdafx.h包含stdafx.cpp 05/26 01:06
5F:→ jerohands:我讲的是VC.NET的用法,其他IDE我不晓得是否通用 05/26 01:07
6F:推 Ebergies:你不会觉得奇怪为啥 B.h 会有实作吗 05/26 10:35