• ### Announcements

#### Archived

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

## Recommended Posts

Hello guys! Im new to directx, have been doing c++ for a couple of months, I have the "win game programming for gurus" as of today. I tried to compile the first source example in the book and I get errors such as those below. [Linker error] undefined reference to GetStockObject@4'' [Linker error] undefined reference to lpddsback'' [Linker error] undefined reference to Draw_Rectangle(int, int, int, int, int, IDirectDrawSurface7*)'' [Linker error] undefined reference to lpddsback'' [Linker error] undefined reference to Draw_Rectangle(int, int, int, int, int, IDirectDrawSurface7*)'' [Linker error] undefined reference to DD_Init(int, int, int)'' ...it''s more, but I think you got the idea. Im using dev-c++. I have dx9sdk installed and I have set the include-path and the lib-path. I''ve skimmed through the sdk.. but it doesnt say much about linking, so I figure the problem isnt there, but some option in dev-cpp. The sample code makes use of ddraw.h. Do I need to add some parameters for the linker? That is my best guess, since I''ve heard that is needed for OpenGL... if so, what do I need to add? or where can I find info about it? Any hint would be very much appreciated. Thanks for your time. :-)

##### Share on other sites
Did you set up your compiler to work with DirectX?

THIS book rocks.

3D gaming Haven Opening soon.

##### Share on other sites
..more specifically, you need to tell the linker to link with the DirectX libraries. haven''t done any DX programming in a while, but from your post, it looks like you''ll at least need to link to ddraw.lib. you may also need to link with dxguid.lib, not sure about that.

##### Share on other sites
Ohh.. thanks you guys. I haven''t really figured it out yet.. but I will.

I thought I only needed to include the lib-path in dev-cpp compiler options. Uhn.. I see now I missed some obvious things.

• ### Forum Statistics

• Total Topics
628278
• Total Posts
2981784

• 10
• 11
• 17
• 12
• 9