• ### Announcements

#### Archived

This topic is now archived and is closed to further replies.

# What is with the various VC++ compiling problems?

## Recommended Posts

Sir-Smoke    122
It''s starting to get really frustrating when I get linking or compiling errors when using functions in a header file that I know is included correctly (in VC++ 6.0). For example, right now I''m getting compilation error for function DXUtil_ConvertWideStringToGeneric, and it''s telling me it''s an undeclared identifier. Yet it is declared right in the DXUtil.h and DXUtil.cpp, that are in my project as well as included. I have the dplay library included in the settings, basically everything is done exactly as the book. Now here''s the part that gets me, when I copy my code from my current project with this problem, and paste it into a project that was made by the book (replacing previous code), IT DOESNT GIVE ERRORS! How do I fix this type of problem?

#### Share this post

##### Share on other sites
BriTeg    168
Are the DirectX header files in a different folder from your project? If so, your project probably doesn''t have the additional include directories set. Go to your project settings (alt-F7), then click the C/C++ tab, then in the Category drop down, select Preprocessor, then you''ll see the Additional Include Directories. Type in the path to the DirectX include folder here.

This may not be the solution you need, but it''s the first thing to check for include problems like this.

#### Share this post

##### Share on other sites
Sir-Smoke    122
Yea, I''m certain that isnt a problem in this scenerio. I have #include "dxutil.h", and when I comment it out, I get more errors. Though this time around, the extra errors are ONLY for the header because I use a #define in it, while the other functions not working are in the .cpp >.<

#### Share this post

##### Share on other sites
antareus    576
It should be:

  #include <dxutil.h>

for system headers. If that doesn''t work then you need to add the include files to the search path as BriTeg suggested (and is a good practice).

#### Share this post

##### Share on other sites
Sir-Smoke    122
Nah, #include <DXUtil.h> has the exact same results (not an include path issue), just using "dxutil.h" because the book is using it. But NO way works, and I''ve attempted creating a fresh project several times, I cannot figure out what is wrong. It''s pretty lame having to use a pre-made project off a CD that is not visiably different in any way (grr, especially when he goes as far as to tell you step by step how to setup the projects he made).

I''m not new at having to include libraries and all, so I''m just gonna ''sigh'' this one off

#### Share this post

##### Share on other sites
ISOPimp    122
Just throwin in some thoughts...

Do you and the book have the same directx version?
Did you triple check spelling (by looking in the .h file)?
Did you check the books website for errata (if it has one of course)

Good Luck.

#### Share this post

##### Share on other sites
Sir-Smoke    122

Well, I tried the files from my DXSDK as well as the one on the CD (the project off the CD works with my DX just fine anyways).

I''m 100% positive on spelling, as I copied the function and did a ctrl-f to find them in the .h and .cpp... they are there, the compiler just isn''t using it when I make the project.

It''s a prima book, I tried to load up the URL on the book and nada but a dead link. Even googled the URL, which accomplished nothing hehe.

I''ve had problems like this before, but normally it''s linking errors so this is a real nut scratcher.

#### Share this post

##### Share on other sites
Guest Anonymous Poster
Are you sure you are linking in your libraries? you need to link with d3d9.lib (and d3dx9.lib, if you use D3DX) to use Direct3D. Otherwise your individual files will compile, but the linking phase will fail.

And don''t blame stuff like this on VC, you are obviously doing something wrong.

#### Share this post

##### Share on other sites
Sir-Smoke    122
Yea, the linking is all correctly done (I even have valid projects to compare to). If it was so obvious I''m doing something wrong, I wouldn''t blame VC. Possible it could be a bad install or something

#### Share this post

##### Share on other sites
Sir-Smoke    122
Well, it works now after rebooting the computer. I have no way of knowing what went wrong... but it works! Yay!

I cant be the only one thats had weird problems like this, where something stops working, and can even start working again, for literally no reason!