【问题标题】:Error building ace in solaris and linux在 solaris 和 linux 中构建 ace 时出错
【发布时间】:2015-01-09 03:30:29
【问题描述】:

我在 linux 中构建 ace 5.3 时遇到问题。我收到以下错误。

g++ -W -Wall -Wpointer-arith -pipe -O3 -g -Wno-uninitialized -fno-implicit-templates   -DACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION -D_POSIX_THREADS -D_POSIX_THREAD_SAFE_FUNCTIONS -D_REENTRANT   -I/home/vwickram/Ubuntu_Release/tmp/ACE_wrappers -DACE_HAS_EXCEPTIONS  -L/home/vwickram/Ubuntu_Release/tmp/ACE_wrappers/ace -L./ -o gperf .obj/gperf.o .obj/Options.o .obj/Iterator.o .obj/Gen_Perf.o .obj/Key_List.o .obj/List_Node.o .obj/Hash_Table.o .obj/Bool_Array.o .obj/Vectors.o .obj/Version.o  -lACE -ldl -lpthread
/home/vwickram/Ubuntu_Release/tmp/ACE_wrappers/ace/libACE.so: undefined reference to `aio_return'
/home/vwickram/Ubuntu_Release/tmp/ACE_wrappers/ace/libACE.so: undefined reference to `aio_read'
/home/vwickram/Ubuntu_Release/tmp/ACE_wrappers/ace/libACE.so: undefined reference to `aio_cancel'
/home/vwickram/Ubuntu_Release/tmp/ACE_wrappers/ace/libACE.so: undefined reference to `aio_error'
/home/vwickram/Ubuntu_Release/tmp/ACE_wrappers/ace/libACE.so: undefined reference to `aio_write'
/home/vwickram/Ubuntu_Release/tmp/ACE_wrappers/ace/libACE.so: undefined reference to `aio_suspend'
collect2: ld returned 1 exit status
make[2]: *** [gperf] Error 1
make[2]: Leaving directory `/home/vwickram/Ubuntu_Release/tmp/ACE_wrappers/apps/gperf/src'
make[1]: *** [src.subdir] Error 2
make[1]: Leaving directory `/home/vwickram/Ubuntu_Release/tmp/ACE_wrappers/apps/gperf'
make: *** [all.nested] Error 2

当我用谷歌搜索时,我发现这是 ace5.3 中的一个错误,并且在以后的版本中已修复。所以我得到了ace 6.3版本并设法在linux中构建。但是,ace 6.3 不会在带有 sunstudio 11 编译器的 SolarisX86 中构建。我得到以下。

ACE::Monitor_Control::Monitor_Point_Registry*ACE_Singleton<ACE::Monitor_Control::Monitor_Point_Registry,ACE_Thread_Mutex>::instance() /home/vwickram/Ubuntu_Release/ace6.3/tmp/ACE_wrappers/lib/libACE.so
ld: fatal: Symbol referencing errors. No output written to ace_gperf
gmake[1]: *** [ace_gperf] Error 1
gmake[1]: Leaving directory `/home/vwickram/Ubuntu_Release/ace6.3/tmp/ACE_wrappers/apps/gperf/src'
gmake: *** [gperf] Error 2

有人可以帮忙吗?我还是更喜欢使用 ace 5.3 版本并使用补丁来修复错误并使其构建在 linux 上。

【问题讨论】:

  • ACE 邮件列表是提出这个问题的更好地方,请参阅cs.wustl.edu/~schmidt/ACE-mail.html。不确定 sunstudio 编译器的问题,你在 Solaris 上试过 gcc 吗?
  • Solaris 上的警告以 Ubuntu 作为目录,这是您得到的真正错误吗?

标签: linux solaris ace sunstudio


【解决方案1】:

我在 ubuntu 14.04 for Ace 5.5 上遇到了类似的问题。

我检查了整个控制台日志,在 /usr/lib 中找不到 librt.solibrt.so.1 在 /lib/

我搜索了这些并在 /usr/lib/x86_64-linux-gnu/librt.so/lib/x86_64-linux-gnu/librt.so.1 中找到了它们

我将它们复制到受尊重的文件夹中,然后它运行良好,没有任何错误。

在 i386 上的 librt 位于 /usr/lib/i386-linux-gnu/librt.so

【讨论】:

  • 正确的解决方案是将文件夹添加到链接器搜索路径中,方法是添加标志-L/usr/lib/x86_64-linux-gnu
【解决方案2】:

安装异步库。

例如在 Fedora-linux 中它将是 libaio-devel。 (大部分不需要,但如果不安装可能会出现一些问题)

安装后使用以下标志编译。

cc file.c -lrt

-lrt - 链接(lrt)读取时间库。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-10-15
    • 2019-03-17
    • 2019-02-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多