🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

game programmer newbie

Started by
4 comments, last by ng seng yim 24 years, 4 months ago
I''m using Borland C++5.0, DirectX SDK 6.1, and tried to build the T3DCHAP01 freakout game project in LaMothe''s Tips of Win Game Programming gurus book CD, but the linker came up with following errors: Info :Linking C:\WINPROGS\T3D\freakout.exe Error:Error: Unresolved external ''_lpddsback'' referenced from module freakout.cpp Error:Error: Unresolved external ''Draw_Rectangle(int,int,int,int,int,IDirectDrawSurface4*)'' referenced from module freakout.cpp Error:Error: Unresolved external ''DD_Init(int,int,int)'' referenced from module freakout.cpp Error:Error: Unresolved external ''Start_Clock()'' referenced from module freakout.cpp Error:Error: Unresolved external ''Draw_Text_GDI(char*,int,int,int,IDirectDrawSurface4*)'' referenced from module freakout.cpp Error:Error: Unresolved external ''DD_Flip()'' referenced from module freakout.cpp Error:Error: Unresolved external ''Wait_Clock(unsigned long)'' referenced from module freakout.cpp Error:Error: Unresolved external ''DD_Shutdown()'' referenced from module freakout.cpp I have compiled before Win programs successfully, so I don''t understand why. All the relevant .h , .lib files have been specified in the search paths and project file. Pls help me! syng
syng
Advertisement
Hmmm... did you include the Borland-DX-libs? (As far as i know, Borland compilers reqire special libs).

If you did, I can''t help you
i think you are using lamothe''s own little engine, right? well in that case you would have to link his lib file(s) to get it to compile properly.
Yes, I did include the Borland lib directories.
Guys, if you don''t mind a litttle trouble, I hope you could try out building the files (under BC++5.00 preferably ). I posted the issue and the related files in the newsgroup borland.public.attachments at
http://www.borland.com/newsgroups.
Check out the original post "linker error message" by me, posted on 22/1/00 11.46am. The attached files are there too.
From the linker error msgs, I don''t think the problem is coming from the DirectX libraries but rather from the freakout.cpp way of referencing the functions in blackbox.cpp. I can''t see anything wrong. Can you?

Hope you could pass this info to whoever who can help.
Thanks...

syng
syng
Guys,
any update on the problem above ? Need help here...

syng
syng
I found out the cause... probably a typo error in specifying the paths somewhere... Anyway, I include the steps needed to build the game below. Hope it helps anyone who''s still struggling...


How to compile the Chap01 freakout project from
Andre La Mothe''s "Trick of the Windows Game Programming Gurus"
under BC++5.00.
Below is 1 simple method for BC++ newbies.
I only tested with BC++5.00 and DirectX SDK 6.1.

Pls install DirectX SDK 6.1 first as described in the above book.

1)Create a folder, eg. C:\t3d\chap01.
Create another folder, eg. C:\game.

2)Copy all source and header files from the CDROM''s Source\T3DCHAP01
to C:\t3d\chap01.

3)Run BC++.

4)From IDE menu, choose Options>Project.
Ensure that Source Directories include box has "c:\bc5\include"
and library box has "c:\bc5\lib". In Output Directories box,
type name of Intermediate and Final as "c:\game". Choose OK.

5)From IDE menu, choose File>New>Project
Key in Project path and name, eg. C:\t3d\chap01\freakout.ide
Target type= application (.exe), platform= Win32, Target model GUI
Uncheck all the frameworks, controls, libraries boxes except dynamic.
From Advanced, check only .cpp node, since no .rc, no .def used.
Select OK.

6)From the Project view window, right click on the freakout.exe node
and add the following nodes to it:
blackbox.cpp, blackbox.h (from the C:\t3d\chap01 folder)
ddraw.lib from (C:\mssdk\lib\borland\ddraw.lib)

7)Right click on the freakout.cpp node and choose view>text edit
In the freakout.cpp window, change the line "#include " to
"include C:\mssdk\include\ddraw.h".
Do the same for blackbox.cpp node.

8)From IDE menu, choose Project>Build All

9)It will build properly with the following Buildtime message:
Info :Compiling C:\t3d\chap01\blackbox.cpp
Warn :blackbox.cpp(127,31):Conversion may lose significant digits
Warn :blackbox.cpp(130,33):Conversion may lose significant digits
Warn :blackbox.cpp(133,31):Conversion may lose significant digits
Warn :blackbox.cpp(137,32):Conversion may lose significant digits
Info :Compiling C:\t3d\chap01\freakout.cpp
Warn :DDRAW.H(76,92):Cannot create pre-compiled header: initialized data in header
Warn :freakout.cpp(106,10):Unreachable code
Warn :freakout.cpp(118,16):Unreachable code
Warn :freakout.cpp(125,10):Unreachable code
Warn :freakout.cpp(134,2):''hdc'' is assigned a value that is never used
Warn :freakout.cpp(169,12)ossibly incorrect assignment
Warn :freakout.cpp(221,2):''ps'' is declared but never used
Warn :freakout.cpp(221,2):''hdc'' is declared but never used
Warn :freakout.cpp(221,2)arameter ''hprevinstance'' is never used
Warn :freakout.cpp(221,2)arameter ''lpcmdline'' is never used
Warn :freakout.cpp(221,2)arameter ''ncmdshow'' is never used
Warn :freakout.cpp(234,2)arameter ''parms'' is never used
Warn :freakout.cpp(247,2)arameter ''parms'' is never used
Warn :freakout.cpp(256,28):Conversion may lose significant digits
Warn :freakout.cpp(265,2):''x1'' is assigned a value that is never used
Warn :freakout.cpp(313,2):''x1'' is assigned a value that is never used
Warn :freakout.cpp(601,2)arameter ''parms'' is never used
Info :Linking C:\GAME\freakout.exe

10)From IDE menu, choose Debug>Run, and play the game.
From keyboard, left arrow and right arrow plays the game.
Quit game by pressing Esc.

11)You will return back to IDE. Now inspect your Runtime message
and you should see similar to the following:
Info :Ensuring executable is up to date
Info :Loading: C:\GAME\freakout.exe
Info rocess Created: C:\GAME\freakout.exe
Info rocess start start. Process Id 0x2 initial thread Id 0xffc3248d base address 0x4d2
Info :Module load . Has debug info; base address 0x400000 thread Id 0xffc3248d
Info :Module load . No debug info; base address 0xbfeb0000 thread Id 0xffc3248d
Info :Module load . No debug info; base address 0xbfe30000 thread Id 0xffc3248d
Info :Module load . No debug info; base address 0xbfee0000 thread Id 0xffc3248d
Info :Module load . No debug info; base address 0xbaaa0000 thread Id 0xffc3248d
Info :Module load . No debug info; base address 0xbfec0000 thread Id 0xffc3248d
Info :Module load . No debug info; base address 0xbff30000 thread Id 0xffc3248d
Info :Module load . No debug info; base address 0xbff60000 thread Id 0xffc3248d
Info :Module load . No debug info; base address 0xbff70000 thread Id 0xffc3248d
Info :Module load . No debug info; base address 0x420000 thread Id 0xffc3248d
Info :Thread stopped C:\GAME\freakout.exe: At breakpoint
Info :Running
Info rocess exit . Last thread Id 0xffc3248d
Info rocess terminated: C:\GAME\freakout.exe

12)From IDE menu, choose Project>Close project.
It will tell you that the source files are read only.
Make you life easy- from Windows Explorer,
select your freakout.cpp, blackbox.cpp and blackbox.h.
Right click on the selected files and blank the Read-only box.

13)From IDE menu, choose Project>Close project.
It will close successfully.





syng
syng

This topic is closed to new replies.

Advertisement