سؤال

I'm trying to start playing around with the <amp.h> library. But when I type #include amp.h, I get an error saying cannot open source file <amp.h>. Is there something special I need to do to make this available?

#include <stdio.h>
#include <tchar.h>
#include <amp.h>
هل كانت مفيدة؟

المحلول

C++ AMP requires not only the amp.h header file, but a new compiler (in order to understand the restrict keyword, for example). The Developer Preview of VS 11 (either the one you can download onto a Windows 7 machine or the one that comes with the Developer Preview image of Windows 8) has the compiler you need. Your existing copy of VS 2010 (or whatever) does not. Getting the header file into your include path won't be enough. If you have the right compiler, you will discover that amp.h is on your include path already.


Check out this April 2012 MSDN Magainze Article for more info on C++ AMP

نصائح أخرى

amp.h must not be available in your standard library include paths.

If this is a not-often-used header file, I'd add the library include files into your project and include them from there.

If not, I'd search for amp.h on your filesystem, try including it using #include "amp.h" and then add the path where it is to my library include paths on your VS project.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top