Advertisement

For anyone who ever used this book

Started by July 16, 2000 12:06 AM
17 comments, last by Fender148 24 years, 5 months ago
Ive been using Andre LaMothe''s "Tricks of the Windows Game Programming Gurus" to learn how to use DirectX to make a game. Ive posted many times about this book and some people are probably sick of me but I was wondering if anyone else who read ran into the same problems I have and could offer any advice. Right now Im on chapter 7 and trying to load a bitmap, just one, on my screen. I decided to use his libraries he gives to do this and a lot of the code has errors in it and stuff and I run into a lot of linking errors, when I try to use the Load_Bitmap_File function for example I get an unresolved external symbol error. Part of that probably is my lack of knowledge on including headers and stuff into my projects in correct orders. I remembering reading in a post that he put changes to the files on his web site but I dont remember the address or anything about it. So if anyone could give me any insight or advice on this subject at all I would be happy. Thanks
hey,
could you post some of your errors please? I had a LOT of problems with his code too. Maybe I, or someone else could help you if you gave something more specific.

skitzo_smurf


"Innocent is just a nice way to say ignorant, and stupidity is ignorance with its clothes off."words of,skitzo_smurf
Advertisement
My biggest problem is using the t3dlib1.h and t3dlib1.cpp files
I include t3dlib1.h in my main and make a call to the Load_Bitmap_File function and get "unresolved external symbol" error. I was thinking it could be because Im not including the t3dlib1.cpp file. For kicks I added that to my project and compiled it and it had many error and warnings in the code alone.
So I took one of his example programs (demo7_10) that loaded a bitmap on the screen with the function declared in the main source file and it works, but when I put my own bitmap in the function call I dont get anything but that could simply be due to his being a full screen bitmap and mine being much smaller and my not changing the code. Thanks for replying and hopefully I gave enough to give me a little help thanks
Unresolved external error means your compiler can''t find the library.
If you''re using vc++, go to project->settings on the menu bar.On the settings dialog, change the drop-down list box to ''all configurations'', then choose the ''link'' tab.In the text box labeled ''Object/library'' type the file name of the lib file (including the path), then hit the ok button.Recompile.
If you''re using a different compiler package, take a look at the documentation for linking; that''s waht its there for.

Good luck



----------
meh
----------meh
Its not a lib file, its a .cpp file with a header, ?
Its not a lib file, its a .cpp file with a header, ?
Advertisement
Heh, forgot a few things...make sure the header file you''re using has all the function prototypes your application is using in it.If not, just add them to the header file.This would give you an undefinde reference error during compile time
Also, sometimes libraries are a pain in the cheese-wheel and won''t load even if you link them correctly (I''m not very interested in the problem, and I don''t use a whole lot of extra libraries, so I just work around it).This wouldn''t give you an error at link or compile time, but all the functions in the library will fail.Call LoadLibrary() and load the dll, you don''t have to worry about unloading it, when all processes are finished with it, windows will unload it for you.If you end up having to do this, make sure you update your configuration so that when it links, its not linking with that library anymore (because your application is already linking it).
Don''t know if any of that will help, never used this library before.



----------
meh
----------meh
Didn''t know that...sorry.Did you add the cpp file to your project? It doesn''t matter which order you compile in; your compiler will compile all the files, then the linker links all the modules.
----------meh
well I included the t3dlib1.cpp file, it has some errors in it but I think if they are fixed I can put this problem behind me


\t3dlib1.cpp(160) : error C2664: ''CreateSurface'' : cannot convert parameter 1 from ''struct _DDSURFACEDESC2 *'' to ''struct _DDSURFACEDESC *''

>>>> here, this error occurs three times
if (FAILED(lpdd->CreateSurface(&ddsd,&(bob->images[index]),NULL)))
return(0);

\t3dlib1.cpp(754) : error C2660: ''SetDisplayMode'' : function does not take 5 parameters

>>>>> I use this in my main and I use 5 params no problem, no clue on this



I heard that the files on the disc were corrupted. A LOT of people posted here complaining about that. I too, could not get his code to compile right off of the disc(and YES I removed the "read only" attribute). I had to take what I wanted to use and basically paste it into my own utility header file to get it to work. I only use his Load_Bitmap_File function so this is not a problem. ANyhow, if that doesnt work make sure you have the following lib''s included:

dxgiud.lib and ddraw.lib

To include them just click on Project->Settings. THen click on the link tab and enter those lib''s in the text field and click "ok".


keep complaining if this doesnt work for you,
skitzo_smurf
"Innocent is just a nice way to say ignorant, and stupidity is ignorance with its clothes off."words of,skitzo_smurf

This topic is closed to new replies.

Advertisement