简体   繁体   English

使用CUnit获取“ld:找不到-lcunit”错误

[英]Getting a “ld: cannot find -lcunit” error with CUnit

I'm using NetBeans 7.1 on Windows 7. I downloaded the CUnit archive and used shell scripts supplied with the archive to install it ( $make install , etc.). 我在Windows 7上使用NetBeans 7.1。我下载了CUnit存档并使用随存档提供的shell脚本来安装它( $make install等)。 I'm using Cygwin as my compiler, and whenever I try to build the unit test, I get the following error: 我正在使用Cygwin作为我的编译器,每当我尝试构建单元测试时,我都会收到以下错误:

/usr/lib/gcc/i686-pc-cygwin/4.3.4/../../../../i686-pc-cygwin/bin/ld: cannot find -lcunit

Obviously, the linker (ld) doesn't know where to look for something, but I don't know the intricacies of how this stuff works. 显然,链接器(ld)不知道在哪里寻找东西,但我不知道这些东西如何工作的复杂性。 Searching for lcunit on my computer didn't return anything except for the makefile of this project. 在我的计算机上搜索lcunit除了这个项目的makefile之外没有返回任何内容。

One thing I think I should mention is that when I installed CUnit, NetBeans did not know where to look for it. 我认为应该提到的一件事是,当我安装CUnit时,NetBeans不知道在哪里寻找它。 It got installed into /usr/local/ and this was not one of the paths NetBeans parsed. 它已安装到/ usr / local /中,这不是NetBeans解析的路径之一。

"-lcunit" is just a flag/option instructing your compiler to link all cunit stuff in your app. “-lcunit”只是一个标志/选项,指示您的编译器链接您应用中的所有cunit内容。 usage could be something like this (gcc): 用法可能是这样的(gcc):

gcc test.c -lcunit -o test

looks like your compiler doesn't know what to do with this flag... :/ 看起来你的编译器不知道如何处理这个标志......:/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM