• Advertisement
Sign in to follow this  

library headers directory structure

This topic is 3317 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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.

Share this post


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

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
Sign in to follow this  

  • Advertisement