Problem with Program not including Direct X libraries/headers

Started by
1 comment, last by pghTech 17 years, 7 months ago
I am going through a book tutorial, and I have copied the code, line for line, and setup the directory structure with the same files exactly the same as the book's source code/directories. Using the same IDE (VC++ 2005), when I load up the book's source code project and compile, it compiles without issue. However, when I load up my project and compile it is not including the objbase.h in library ole32.lib and therefore doesn't recognize functions such as: CoInitializeEx UnIntializeEx I checked the Books source code project settings, and both the books and my project Include and library directory setup is exactly the same with it including the ...\Microsoft DirectX 9.0 SDK for both the (Lib and Include Dir's). The only difference I see is in the books project setting: "Preprocessor Definitions" it is including _WIN32_DCOM and mine isn't. If this is the problem then I have two questions: The first question would be - I am not sure what I would need to do to get that included as I am not that familiar with setting up "Preprocessor Definitions". The second question is if this is standard? do you have to set the preprocessor definitions? Or is there some way else through the VC project that it should have, or I should have set to use _WIN32_DCOM?
Advertisement
ole32.lib is not specific to DirectX, it's a Windows library. If you go to the project settings, under configuration properties, Linker, Input there's a field called Additional Dependencies. Add it there, if it's not there.

Are you using VC Express? IIRC, it didn't come with the Platform SDK, which you may have to download and install separately to get those libs and headers.
Thanks Kanato

I am using VC++ 2005 standard (not the express).

I found doing some hunting, that I had to add the

#define _WIN32_DCOM

directive to the program for it to included it. According to some literature, the near version of Direct X requires it.

This topic is closed to new replies.

Advertisement