| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • Work with all your cloud files (Drive, Dropbox, and Slack and Gmail attachments) and documents (Google Docs, Sheets, and Notion) in one place. Try Dokkio (from the makers of PBworks) for free. Now available on the web, Mac, Windows, and as a Chrome extension!

View
 

CppDevelopmentNotes

Page history last edited by David B 10 years, 5 months ago

 

Tinypig Blog

Tinypig Home

Tinypig Wiki

 

About Me 

 

Compiling

 

"unexpected end of file while looking for precompiled header directive"

for the file that got the error:

Project->Settings->select file on left->C/C++ tab->Category->Precompiled Headers->Not using precompiled headers

 


 

Problem:

 

When building a DirectX program you get the following error:

 

 

    program.obj : error LNK2001: unresolved external symbol _IID_IDirectDraw4 

    program.obj : error LNK2001: unresolved external symbol _DirectDrawCreate@12 

 

Solution (from a post by Simon):

 

  • Go to the Project->Settings... menu
  • select the Link tab, with General in Category
  • Where it says Object/Library modules, (things like kernel32.lib etc), add ddraw.lib and dxguid.lib
  • The first .lib tells the linker where to find DirectDraw functions
  • The second .lib tells the linker what IID_IDirectDrawXXXX etc means

 


 

Play a sound:

 

 

#include "mmsystem.h"
add library: winmm.lib

 

From a file:

 

PlaySound("d:\dmb\tmp\bounce.wav",NULL,SND_FILENAME);

 

From the system sounds:

 

PlaySound("SystemStart",NULL, SND_ALIAS|SND_ASYNC|SND_NOSTOP);

 

For a list of other system sounds see registry entry:

 

HKEY_CURRENT_USERAppEventsEventLabels (SystemStart,SystemExit, etc)

Comments (0)

You don't have permission to comment on this page.