简体   繁体   中英

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.). I'm using Cygwin as my compiler, and whenever I try to build the unit test, I get the following error:

/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. Searching for lcunit on my computer didn't return anything except for the makefile of this project.

One thing I think I should mention is that when I installed CUnit, NetBeans did not know where to look for it. It got installed into /usr/local/ and this was not one of the paths NetBeans parsed.

"-lcunit" is just a flag/option instructing your compiler to link all cunit stuff in your app. usage could be something like this (gcc):

gcc test.c -lcunit -o test

looks like your compiler doesn't know what to do with this flag... :/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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