jonathanliu2004 发表于 2008-6-16 20:39:21

undefined reference to `ACE_Singleton<xxx>::instance()'

我在编译Share_memory的时候,遇要这个问题了。

# pwd
/home/cyliu/project/src/ACE_wrappers/examples/APG/Shared_Memory
# make
make: Entering directory `/home/cyliu/project/src/ACE_wrappers/examples/APG/Shared_Memory'

GNUmakefile: /home/cyliu/project/src/ACE_wrappers/examples/APG/Shared_Memory/GNUmakefile.Malloc MAKEFLAGS=w

make: Leaving directory `/home/cyliu/project/src/ACE_wrappers/examples/APG/Shared_Memory'
make: Entering directory `/home/cyliu/project/src/ACE_wrappers/examples/APG/Shared_Memory'

GNUmakefile: /home/cyliu/project/src/ACE_wrappers/examples/APG/Shared_Memory/GNUmakefile.Mem_Map MAKEFLAGS=w

make: Leaving directory `/home/cyliu/project/src/ACE_wrappers/examples/APG/Shared_Memory'
make: Entering directory `/home/cyliu/project/src/ACE_wrappers/examples/APG/Shared_Memory'

GNUmakefile: /home/cyliu/project/src/ACE_wrappers/examples/APG/Shared_Memory/GNUmakefile.PI_Malloc MAKEFLAGS=w

g++ -fvisibility=hidden -fvisibility-inlines-hidden -W -Wall -Wpointer-arith -O3 -g -pipe    -pipe -D_GNU_SOURCE -DACE_HAS_LINUX_NPTL -D_REENTRANT -DACE_HAS_AIO_CALLS -D_GNU_SOURCE   -I/home/cyliu/project/src/ACE_wrappers -DACE_HAS_EXCEPTIONS -D__ACE_INLINE__ -I../../..-Wl,-E -L/home/cyliu/project/src/ACE_wrappers/ace -L./ -L/home/cyliu/project/src/ACE_wrappers/lib -L. -L../../../lib -o PI_Malloc .obj/PI_Malloc.o -lACE -lposix-aio -ldl -lpthread -lrt
.obj/PI_Malloc.o: In function `ACE_Based_Pointer_Basic':
/home/cyliu/project/src/ACE_wrappers/ace/Based_Pointer_T.cpp:64: undefined reference to `ACE_Singleton<ACE_Based_Pointer_Repository, ACE_RW_Thread_Mutex>::instance()'
collect2: ld 返回 1
make: *** 错误 1
make: Leaving directory `/home/cyliu/project/src/ACE_wrappers/examples/APG/Shared_Memory'
make: *** 错误 2
#


为什么呢?怎么解决呢?

winston 发表于 2008-6-17 12:00:57

好像这个Shared_Memory需要打开编译宏,你看看头文件。

jonathanliu2004 发表于 2008-6-19 10:45:14

哪个头文件能够控制呢?找了半天还是一头露水阿。版主在进一步给个点拨
页: [1]
查看完整版本: undefined reference to `ACE_Singleton<xxx>::instance()'