[英]Setting Eclipse CDT with cygwin 1.7 for gtest
I am running a simple gtest sample in eclipse CDT using cygwin, initially i was getting error as 我正在使用cygwin在Eclipse CDT中运行一个简单的gtest示例,最初我遇到了以下错误:
make***multiple target pattern
Then I changed the library path from D:/
to /cygdrive/d/
and the error is gone but now it is telling 然后我将库路径从
D:/
更改为/cygdrive/d/
,错误消失了,但现在它告诉我们
undefined reference to blah blah files
collect2: ld returned 1 exit status
make: *** [sample_gmock.exe] Error 1
I checked the makefile and objects.mk all the things are proper there 我检查了makefile和objects.mk所有东西都在那里
g++ -L"/cygdrive/D/Project/gmock-1.6.0/gtest/make" -o "sample_gmock.exe"
./src/sample1.o ./src/sample1_unittest.o /cygdrive/D/Project/gmock-1.6.0/gtest
/make/gtest_main.a -lpthread
What should I do to resolve and make it work, so that I am able to run gmock and gtest in eclipse using cygwin 我应该怎么做才能解决并使其正常工作,以便能够使用cygwin在eclipse中运行gmock和gtest
At first I was working on Linux environment and had gmock_main.a and gtest_main.a generated over there. 最初,我在Linux环境上工作, 并在那里生成了gmock_main.a和gtest_main.a 。 Same files I was using in Windows environment in Eclipse, so it was giving error.
我在Eclipse的Windows环境中使用的文件相同,因此出现错误。
To get rid of the error I compiled the gmock and gtest code in cygwin terminal to generate gmock_main.a and gtest_main.a , and its working fine. 为了消除错误,我在cygwin终端中编译了gmock和gtest代码,以生成gmock_main.a和gtest_main.a ,并且工作正常。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.