#include <al/alc.h>
#include <al/alut.h>
library headers directory structure
Usually you don't #include your .c or .cpp files.
Are you 100% positive that you need to include the .c file? Because I'm 90% sure you shouldn't.
Are you 100% positive that you need to include the .c file? Because I'm 90% sure you shouldn't.
So, in other words, alut.h already includes alc.h? In that case, you only need to include al/alut.h. If that's not the case, then exactly what error messages do you get?
Error:
C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include\al/alut.h(5) : fatal error C1083: Cannot open include file: 'alc.h': No such file or directory
alut.h includes <alc.h> instead of <al/alc.h> like I'm using. For now I've put it where it wants but I sure would like to understand how this works.
C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include\al/alut.h(5) : fatal error C1083: Cannot open include file: 'alc.h': No such file or directory
alut.h includes <alc.h> instead of <al/alc.h> like I'm using. For now I've put it where it wants but I sure would like to understand how this works.
the way to solve your problem without altering any files is to include "C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include\al\" in your include search directories list. I'm not familiar with Visual Studio, so you'll have to consult the documentation or someone else for the exact process, but that should point you in the right direction.
Essentially the idea is that when you include a file, the compiler takes a list of directories and searches for the path you specified in each until it finds the file, and spits out an error if it exhausts the list without finding the file, which is what's happening here.
The compiler sees your include of "al/alut.h" and goes through its list until it finds "C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include\al/alut.h", then it processes that file and finds the include of "alc.h", whereupon the compiler starts over at the beginning of its list, but it can't find "C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include\alc.h" so it spits out an error.
If you add "C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include\al\" to the directory list, the compiler will, in perusing its list, check for "C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include\al\alc.h" where the file actually exists.
Essentially the idea is that when you include a file, the compiler takes a list of directories and searches for the path you specified in each until it finds the file, and spits out an error if it exhausts the list without finding the file, which is what's happening here.
The compiler sees your include of "al/alut.h" and goes through its list until it finds "C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include\al/alut.h", then it processes that file and finds the include of "alc.h", whereupon the compiler starts over at the beginning of its list, but it can't find "C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include\alc.h" so it spits out an error.
If you add "C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include\al\" to the directory list, the compiler will, in perusing its list, check for "C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include\al\alc.h" where the file actually exists.
That's because both "Include\" and "Include\al\" are in the list. If you include "al/alut.h" it won't be able to find "Include\al\al/alut.h" but it can find "Include\al/alut.h", so it uses that. Conversely if you omit the directory, it can't find "Include\alut.h" but it can find "Include\al\alut.h".
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement