Thread: Unresolved External

  1. #1
    Registered User
    Join Date
    Dec 2004
    Posts
    73

    Unresolved External

    If you read my post "Tga" earlier about the image library i am creating that relates to this post as well. This time I am having a problem somewhere that I can't find. The two errors I get are both Unresolved External errors for the function DBIL_Initialize() and the function DBIL_DeInitialize() because those are the only two I'm calling from the DLL. Here is my code, please help.

    "Main.h" (Where I import from DLL)
    Code:
    #include <windows.h>
    #include <ddraw.h>
    
    #define DLLEXP __declspec(dllexport)
    
    #pragma comment(lib,"ddraw.lib")
    #pragma comment(lib,"dxguid.lib")
    
    #define g_szClassName "CLASS!"
    
    // Image Types For DBIL_LoadImage() Function
    #define BITMAP_IMAGE_FILE 0x00AA
    #define TARGA_IMAGE_FILE 0x00BB
    
    // Methods Of Display For DBIL_DisplayImage() Function
    #define NORMAL_IMAGE 0x00AAAA
    #define TRANSPARENT_IMAGE 0x00AABB
    #define BACKGROUND_IMAGE 0x00AACC
    #define PORTION_IMAGE 0x00AADD
    
    enum
    {
    	ePrimary,
    	eBack,
    	eMaxSurfaces,
    };
    
    typedef struct
    {
        BYTE IDLength;
        BYTE ColorMapType;
        BYTE ImageType;
        WORD CMapStart;
        WORD CMapLength;
        BYTE CMapDepth;
        WORD XOffset;
        WORD YOffset;
        WORD Width;
        WORD Height;
        BYTE PixelDepth;
        BYTE ImageDescriptor;
    } TGA_Header;
    
    typedef struct
    {
        HWND hWnd;
        RECT Rect;
        HANDLE Compatible;
        HANDLE Old;
        HDC Front;
        HDC Back;
        HDC Bitmap;
    } BUFFER;
    
    typedef struct
    {
    	LPDIRECTDRAW2 Interface;
    	LPDIRECTDRAWSURFACE Surfaces[eMaxSurfaces];
    	LPDIRECTDRAWCLIPPER Clipper;
    } TRANS_IMAGE;
    
    LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
    
    DLLEXP HBITMAP DBIL_LoadImage(HINSTANCE, LPSTR, UINT, UINT);
    DLLEXP bool DBIL_Initialize(BUFFER, TRANS_IMAGE, HWND);
    DLLEXP bool DBIL_DisplayImage(BUFFER, HBITMAP, UINT, INT, INT, RECT, TRANS_IMAGE);
    DLLEXP bool DBIL_DeInitialize(BUFFER, TRANS_IMAGE);
    DLLEXP bool DBIL_ClearScreen(HDC, RECT, INT);
    "Main.cpp" (I'm just posting where I have the problem)
    Code:
    #include "Main.h"
    ...........................
    
    case WM_CREATE:
    	DBIL_Initialize(pBuffer, pTrans, hWnd);
    	break;
    
    ...........................
    
    case WM_DESTROY:
    	DBIL_DeInitialize(pBuffer, pTrans);
            PostQuitMessage(0);
    	break;
    
    ...........................
    Last edited by ElWhapo; 05-07-2005 at 10:41 PM.

  2. #2
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,268
    You need to link to the DLL in order to call its functions, or use LoadLibrary() and GetProcAddress().

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiling sample DarkGDK Program
    By Phyxashun in forum Game Programming
    Replies: 6
    Last Post: 01-27-2009, 03:07 AM
  2. C++ std routines
    By siavoshkc in forum C++ Programming
    Replies: 33
    Last Post: 07-28-2006, 12:13 AM
  3. Including lib in a lib
    By bibiteinfo in forum C++ Programming
    Replies: 0
    Last Post: 02-07-2006, 02:28 PM
  4. debug to release modes
    By DavidP in forum Game Programming
    Replies: 5
    Last Post: 03-20-2003, 03:01 PM
  5. Unresolved external symbols in OGL
    By Shadow12345 in forum Game Programming
    Replies: 4
    Last Post: 08-04-2002, 09:46 PM