Click here to Skip to main content
15,887,676 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
when compiling the codes below using MS Visual Studio 2008, i get
C++
fatal error C1083: Cannot open include file: 'altivec.h': No such file or directory



XML
#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;
}
Posted
Updated 18-Mar-10 0:48am
v2

You may add the folder containing the "altivec.h" file to the VC++ 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"

:)
 
Share this answer
 
Try to set the full path to this header
like "usr/smart/my_headers/altivec.h" instead of <altivec.h> :)
 
Share this answer
 
v4
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[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900