【问题标题】:cygwin linking errorcygwin链接错误
【发布时间】:2012-06-13 19:07:46
【问题描述】:

我想用 cygwin 制作网络模拟器 shawn.exe 并且该模拟器需要提升库 当我在链接步骤程序中断中调用它时。 请帮我, 这都是 make 命令的结果:

{.
.
[100%] Built target shawnlib
Scanning dependencies of target shawn
[100%] Building CXX object CMakeFiles/shawn.dir/frontend/console/con_main.o
[100%] Building CXX object CMakeFiles/shawn.dir/apps/apps_init.o
Linking CXX executable shawn.exe
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld: cannot find -lboost_regex-gcc-mt
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld: cannot find -lboost_date_time-gcc-mt
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld: cannot find -lboost_thread-gcc-mt
collect2: ld returned 1 exit status
CMakeFiles/shawn.dir/build.make:111: recipe for target `shawn.exe' failed
make[2]: *** [shawn.exe] Error 1
CMakeFiles/Makefile2:60: recipe for target `CMakeFiles/shawn.dir/all' failed
make[1]: *** [CMakeFiles/shawn.dir/all] Error 2
Makefile:72: recipe for target `all' failed
make: *** [all] Error 2
}

【问题讨论】:

    标签: boost linker


    【解决方案1】:

    确保您已安装 libboost-devel Cygwin 软件包。重新运行 Cygwin 的 setup.exe 并安装该软件包(以及它的依赖项,如果您没有明确排除它们,它们应该会自动安装)。

    【讨论】:

    • 非常感谢。这对我很有帮助,向你致以最诚挚的问候,祝你成功
    • 我不知道 Cygwin 中有 boost 包。我从源代码编译了 boost,我在代码中遇到了奇怪的错误。这对我帮助很大,谢谢!
    【解决方案2】:

    无需重新安装 cygwin。只需运行:
    apt-cyg install libboost-devel.
    如果您没有安装“apt-cyg”,请先运行以下步骤:
    lynx -source rawgit.com/transcode-open/apt-cyg/master/apt-cyg > apt-cyg
    install apt-cyg /bin

    【讨论】:

      猜你喜欢
      • 2013-11-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-09-08
      • 1970-01-01
      • 2011-06-19
      • 2011-12-27
      相关资源
      最近更新 更多