Sign in to follow this  
avocados

library headers directory structure

Recommended Posts

#include <al/alc.h>
#include <al/alut.h>

Visual C express complains because alc.h is linked within alut.h without the "al" directory. What's the proper way to address this issue without altering the alut.h file or moving alc.h? [Edited by - avocados on January 19, 2009 5:18:37 PM]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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".

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this