CodeSourcery 给出编译错误:缺少位/c++config.h
在我的项目中,我使用 Eigen C++ 库进行线性代数。 仅当我打开 ARM NEON 的矢量化标志 (-mfpu=neon -mfloat-abi=softfp) 时,我收到编译器错误 - c++config.h 没有这样的文件或目录。
我无法理解出了什么问题,这是什么bits/c++config.h?我应该怎么做才能解决这个问题?
Vikram
main.c
#include<iostream>
#include <Eigen/Core>
// import most common Eigen types
using namespace Eigen;
int main(int, char *[])
{
Matrix4f m3;
m3 << 1, 2, 3, 0, 4, 5, 6, 0, 7, 8, 9, 0, 0, 0, 0, 0;
Matrix4f m4;
asm("#begins here");
m4 = m3*m3;
asm("#ends here");
std::cout << "m3\n" << m3 << "\nm4:\n" << m4 << std::endl;
std::cout << "DONE!!";
}
生成文件
CPP= /home/ubuntu/CodeSourcery/Sourcery_G++/bin/arm-none-linux-gnueabi-c++
all: main
main: main.cpp
$(CPP) -mfpu=neon -mfloat-abi=softfp -I /home/ubuntu/Documents/eigen/ main.cpp -o main
clean:
rm -rf *o main
错误
**** Build of configuration Debug for project Test_Eigen ****
make all
/home/ubuntu/CodeSourcery/Sourcery_G++/bin/arm-none-linux-gnueabi-c++ -mfpu=neon -mfloat-abi=softfp -I /home/ubuntu/Documents/eigen/ main.cpp -o main
In file included from main.cpp:1:
/home/ubuntu/CodeSourcery/Sourcery_G++/bin/../lib/gcc/arm-none-linux-gnueabi/4.4.1/../../../../arm-none-linux-gnueabi/include/c++/4.4.1/iostream:39: fatal error: bits/c++config.h: No such file or directory
compilation terminated.
make: *** [main] Error 1
in my project I'm making use of Eigen C++ library for linear algebra. ONLY when I turn on the vectorization flags (-mfpu=neon -mfloat-abi=softfp) for ARM NEON, I get a compiler error - c++config.h no such file or directory.
I'm not able to understand whats going wrong, what is this bits/c++config.h? What should I do to fix this problem?
Vikram
main.c
#include<iostream>
#include <Eigen/Core>
// import most common Eigen types
using namespace Eigen;
int main(int, char *[])
{
Matrix4f m3;
m3 << 1, 2, 3, 0, 4, 5, 6, 0, 7, 8, 9, 0, 0, 0, 0, 0;
Matrix4f m4;
asm("#begins here");
m4 = m3*m3;
asm("#ends here");
std::cout << "m3\n" << m3 << "\nm4:\n" << m4 << std::endl;
std::cout << "DONE!!";
}
makefile
CPP= /home/ubuntu/CodeSourcery/Sourcery_G++/bin/arm-none-linux-gnueabi-c++
all: main
main: main.cpp
$(CPP) -mfpu=neon -mfloat-abi=softfp -I /home/ubuntu/Documents/eigen/ main.cpp -o main
clean:
rm -rf *o main
Errors
**** Build of configuration Debug for project Test_Eigen ****
make all
/home/ubuntu/CodeSourcery/Sourcery_G++/bin/arm-none-linux-gnueabi-c++ -mfpu=neon -mfloat-abi=softfp -I /home/ubuntu/Documents/eigen/ main.cpp -o main
In file included from main.cpp:1:
/home/ubuntu/CodeSourcery/Sourcery_G++/bin/../lib/gcc/arm-none-linux-gnueabi/4.4.1/../../../../arm-none-linux-gnueabi/include/c++/4.4.1/iostream:39: fatal error: bits/c++config.h: No such file or directory
compilation terminated.
make: *** [main] Error 1
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我遇到了同样的错误:
在 fedora 15 中安装
libstdc++-devel.x86_64 0:4.6.3-2.fc15
后解决了。I was gettng the same error:
It is resolved after installing
libstdc++-devel.x86_64 0:4.6.3-2.fc15
in fedora 15.我收到了 Codesourcery 团队的回复。这个问题是因为我没有安装所有的附加组件造成的。附加组件的安装是一个非常简单的步骤,如果您在 CodeSourcery 的 Eclipse 环境中运行,那么您只需转到“帮助”>“附加组件”即可。安装新软件,然后就非常简单了(有关更多信息,请参阅入门指南的第三章)。
安装附加组件后,我就不再收到致命错误:bits/c++config.h:没有此类文件或目录编译终止。 (阅读第 3 章有关编译器选项的更多信息)
I got a response from the Codesourcery team. This problem was caused because I had not installed all the add-ons. The installation of the add-ons is a very simple step, if you are running in CodeSourcery's Eclipse environment then you have to just go to Help > Install New Software and after that its pretty straight forward (For more follow the 3rd chapter of getting-started guide).
Once the add-ons were installed, I stopped getting the fatal error: bits/c++config.h: No such file or directory compilation terminated. (Read more about the compiler options from 3rd chapter)