Eclipse C/C++问题+Cygwin(抱怨一切)
Eclipse C/C++ problems + Cygwin (complain on everything)
所以我用Cygwin运行Eclipse C/C++。
我可以顺利运行和编译:
我的test.cpp是:
#include <iostream>
using namespace std;
int main() {
cout << "This is a demonstration! n";
sleep(10);
return 0;
}
我可以用这个makefile成功构建:
**** Build of configuration Release for project HelloWorld ****
make all
Building file: ../test.cpp
Invoking: Cross G++ Compiler
g++ -O3 -Wall -c -fmessage-length=0 -MMD -MP -MF"test.d" -MT"test.d" -o "test.o" "../test.cpp"
cygwin warning:
MS-DOS style path detected: C:UsersDavidcworkspaceHelloWorldRelease
Preferred POSIX equivalent is: /cygdrive/c/Users/David/cworkspace/HelloWorld/Release
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
Finished building: ../test.cpp
Building target: HelloWorld
Invoking: Cross G++ Linker
g++ -o "HelloWorld" ./test.o
Finished building target: HelloWorld
**** Build Finished ****
在那之后,我得到了HelloWorld.exe,我可以很好地运行它。
我的问题是,eclipse抱怨一切!上面说我有很多错误:
Description Resource Path Location Type
Function 'sleep' could not be resolved test.cpp /HelloWorld line 6 Semantic Error
Symbol 'cout' could not be resolved test.cpp /HelloWorld line 5 Semantic Error
Symbol 'std' could not be resolved test.cpp /HelloWorld line 2 Semantic Error
我的意思是,如果你阅读了代码,情况显然不是这样。
我试过:
Index->Update with modified files
Index->Freshen all files
Index->Create parser log file
这是我在其他网站上找到的提示。
我该如何解决这个问题?!
test.cpp是dos文件还是unix文件?隐藏的字符,比如行尾,可能是个问题。
尝试unix2dos test.cpp
相关文章:
- Windows/Cygwin - 不能使用 pybind11 - 犯错误
- 在cygwin中运行c++脚本时发生错误
- 在cygwin中测试新的boost安装时出现cpp错误
- 如何配置Visual Studio Code以使用cygwin,cmake和gcc进行调试
- Cygwin下的gcc 9.3.0预处理器:cmdline -Dname,但名称似乎未定义
- 使用 NVIDIA GPU 在 Cygwin 中链接 OpenCL 库时遇到问题
- 在Cygwin上链接Boost库
- NetBean 和 Cygwin 的 C++ 编译错误?
- 如何从Cygwin下构建的C++程序链接到DLL
- 使用Cygwin C++时出现未定义的引用错误,为什么我的文件没有链接?
- 调用C#中的Cygwin GCC DLL挂在malloc上
- MinGW在Cygwin上.关于链接GNU科学图书馆的一些问题
- 如何在没有Cygwin或Visual Studio的情况下编译Magick++?
- 如何从.NET Core调用cygwin编译的C++
- fork() 无法使用 Cygwin
- 无效参数 C++ cygwin
- 60603 (Fedora Cygwin 5.4.0-2) when using std::cout
- 为什么我不能编译这个在Cygwin的Visual Studio中编写的C++文件?
- FingerJetFXOSE Cygwin 编译错误
- Cygwin pkg-config/protobuf filepath issues