000
07.07.2009, 16:20 Uhr
~Gast123
Gast
|
Weis jemand warum mein Compiler bei den folgenden Zeilenen einen Fehler meldet?
C++: |
//DirectDraw7.h #include <windows.h> #include <stdexcept> #include <string.h> #include "Dictionary.h" #include "d:\Microsoft DirectX SDK\Include\ddraw.h"
class DirectDraw7 { private: LPDIRECTDRAW7 m_lpDDraw7; LPDIRECTDRAWCLIPPER m_lpClipper; Dictionary<int,LPDIRECTDRAWSURFACE7> m_surfDict; public: DirectDraw7(const HWND&,const DWORD&); void CreateClipper(const HWND&,const LPDIRECTDRAWSURFACE7&); void CreateSurface(const unsigned int&,DDSURFACEDESC2&); const LPDIRECTDRAWSURFACE7& GetSurfaceByID(const unsigned int&)const; void LoadBitmap(const unsigned int&,const LPCSTR); };
//DirectDraw7.cpp
void DirectDraw7::LoadBitmap(const unsigned int& id,const LPCSTR lpFilename) { HBITMAP hbm=(HBITMAP)LoadImage(0,lpFilename,IMAGE_BITMAP,0,0,LR_LOADFROMFILE|LR_CREATEDIBSECTION); if(!hbm) { std::string lpcstr="Could not load the bitmap from file: "; lpcstr+=lpFilename; throw((runtime_error)lpcstr); } BITMAP bm; GetObject(hbm,sizeof(bm),&bm); DDSURFACEDESC2 description; description.dwSize=sizeof(DDSURFACEDESC2); description.dwFlags=DDSD_CAPS|DDSD_HEIGHT|DDSD_WIDTH; description.ddsCaps.dwCaps=DDSCAPS_OFFSCREENPLAIN|DDSCAPS_VIDEOMEMORY; description.dwHeight=bm.bmHeight; description.dwWidth=bm.bmWidth; LPDIRECTDRAWSURFACE7 surface; if(m_lpDDraw7->CreateSurface(&description,&surface,0)!=DD_OK) { DeleteObject(hbm); throw((runtime_error)"Could not create surface!"); } HDC hdcPicture=CreateCompatibleDC(0),hdcSurface; SelectObject(hdcPicture,hbm); if(surface->GetDC(&hdcSurface)!=DD_OK) { DeleteDC(hdcPicture); DeleteObject(hbm); throw((runtime_error)"Could not load device-context from surface!"); } BitBlt(hdcSurface,0,0,bm.bmWidth,bm.bmHeight,hdcPicture,0,0,SRCCOPY); surface->ReleaseDC(hdcSurface); DeleteDC(hdcPicture); DeleteObject(hbm); }
|
obj\Debug\DirectDraw7.o||In function `_ZN11DirectDraw711LoadBitmapAERKjPKc' EC++\DirectDraw7\DirectDraw7.cpp|67|undefined reference to `_GetObjectA@12'| EC++\DirectDraw7\DirectDraw7.cpp|77|undefined reference to `_DeleteObject@4'| EC++\DirectDraw7\DirectDraw7.cpp|80|undefined reference to `_CreateCompatibleDC@4'| EC++\DirectDraw7\DirectDraw7.cpp|81|undefined reference to `_SelectObject@8'| EC++\DirectDraw7\DirectDraw7.cpp|84|undefined reference to `_DeleteDC@4'| EC++\DirectDraw7\DirectDraw7.cpp|85|undefined reference to `_DeleteObject@4'| EC++\DirectDraw7\DirectDraw7.cpp|88|undefined reference to `_BitBlt@36'| EC++\DirectDraw7\DirectDraw7.cpp|90|undefined reference to `_DeleteDC@4'| EC++\DirectDraw7\DirectDraw7.cpp|91|undefined reference to `_DeleteObject@4'| DCodeBlocks\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\libmingw32.a(main.o):main.c.text+0x104)||undefined reference to `_WinMain@16'| ||=== Build finished: 10 errors, 0 warnings ===| |