一维阵列的SSE代码,编译器错误:“无法打开包含文件". [英] SSE codes for 1-D ARRAYS, compiler error: "Cannot open include file".
本文介绍了一维阵列的SSE代码,编译器错误:“无法打开包含文件".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用MS Visual Studio 2008编译以下代码时,出现
when compiling the codes below using MS Visual Studio 2008, i get
fatal error C1083: Cannot open include file: 'altivec.h': No such file or directory
#include "stdafx.h"
#include <iostream>
#include <altivec.h>
#include <xmmintrin.h>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
int a[4] __attribute__((aligned(16))) = { 1, 3, 5, 7 };
int b[4] __attribute__((aligned(16))) = { 2, 4, 6, 8 };
int c[4] __attribute__((aligned(16)));
__vector signed int *va = (__vector signed int *) a;
__vector signed int *vb = (__vector signed int *) b;
__vector signed int *vc = (__vector signed int *) c;
*vc = vec_add(*va, *vb);
printf("c[0]=%d, c[1]=%d, c[2]=%d, c[3]=%d¥n", c[0], c[1], c[2], c[3]);
return 0;
}
推荐答案
您可以将包含"altivec.h"文件的文件夹添加到VC++
目录中:
在Visual Studio上,选择工具->选项菜单项,然后选择 Projects and Solutions-> VC ++目录节点,在显示目录列表中选择包含文件,最后添加适当的文件夹.
BTW使用
You may add the folder containing the "altivec.h" file to theVC++
directories:
On Visual Studio choose the Tools->Options menu item, then select the Projects and Solutions->VC++ Directories node, select the Include files in the Show directories for list and finally add the proper folder.
BTW use
#include "altivec.h"
:)
尝试设置此标头的完整路径
类似于"usr/smart/my_headers/altivec.h"
而不是< altivec.h> :)
Try to set the full path to this header
like"usr/smart/my_headers/altivec.h"
instead of <altivec.h> :)
除了上述两个答案,还有一件事
如果没有altivec.h文件,则需要从下载该库此处 [ ^ ]
Apart from the above two answers, one more thing
If you don''t have the altivec.h file then you need to download the library from here[^]
这篇关于一维阵列的SSE代码,编译器错误:“无法打开包含文件".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文