程式不知哪裡有問題
[Linker Error] Unresolved external '_dsk6x_open' referenced from C:\BORLAND\CBUILDER6\PROJECTS\MYPROJECT\TXT\TI.OBJ
[Linker Error] Unresolved external '_dsk6x_hpi_open' referenced from C:\BORLAND\CBUILDER6\PROJECTS\MYPROJECT\TXT\TI.OBJ
[Linker Error] Unresolved external '_dsk6x_board_type' referenced from C:\BORLAND\CBUILDER6\PROJECTS\MYPROJECT\TXT\TI.OBJ
[Linker Error] Unresolved external '_dsk6x_hpi_close' referenced from C:\BORLAND\CBUILDER6\PROJECTS\MYPROJECT\TXT\TI.OBJ 我是使用廠商給的dsk6x11hpi.dll程式並沒有LIBRARY
因此我使用implib dsk6x11hpi.lib dsk6x11hpi.dll 產生library檔案
然後 我使用ADD to Project將dsk6x11hpi.lib加入進去
project->option->advice linker->加入dsk6x11hpi.dll
#include
#pragma hdrstop
#include "dsk6x11hpi.h"
#define little_endian 0;
#define HPI_boot 1;
#define VerboseFlag FALSE;
#define ClearbssFlag FALSE;
#define DumpFlag FALSE;
#include "TI.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
unsigned long FillVal;
char *pfname = "c:\\ti\\c6000\\dsk6x11\\doc\\ti_ppdsk.cfg";
unsigned long TempVar;
dskHANDLE handle;
PdskDLL_BOARD_TYPE board_type;
unsigned short rev_id;
if(!dsk6x_open(pfname,&handle))
ShowMessage("help");
if(!dsk6x_hpi_open(handle))
ShowMessage("help");
if(!dsk6x_board_type(handle,board_type,&rev_id))
ShowMessage("help");
if(!dsk6x_hpi_close(handle))
ShowMessage("help");
我的h檔內容
/*******************************************************************************
* FILENAME
* dsk6x11hpi.h
*
* DESCRIPTION
* The public header file for dsk6x11hpi.dll
*
*******************************************************************************/
#include /* Enumeration used with dsk_board_type */
typedef enum {
TYPE_UNKNOWN = 0,
TYPE_6211_DSK,
TYPE_6711_DSK
} dskDLL_BOARD_TYPE, *PdskDLL_BOARD_TYPE;
/* End of Enumeration used with dsk6x_board_type */ /* DSK Public Handle declaration */
typedef void * dskHANDLE;
/* End of DSK Public Handle declaration */ /* DSK Function Prototypes */
#ifdef __cplusplus
extern "C" {
#endif extern BOOL dsk6x_open(char *, dskHANDLE*);
extern BOOL dsk6x_close(dskHANDLE );
extern BOOL dsk6x_board_type( dskHANDLE , PdskDLL_BOARD_TYPE, unsigned short *);
extern BOOL dsk6x_hpi_open(dskHANDLE );
extern BOOL dsk6x_hpi_close(dskHANDLE );
extern BOOL dsk6x_reset_dsp(dskHANDLE,unsigned char,unsigned char);
extern BOOL dsk6x_reset_board(dskHANDLE);
extern BOOL dsk6x_hpi_read(dskHANDLE ,unsigned long *, unsigned long *, unsigned long);
extern BOOL dsk6x_hpi_write(dskHANDLE ,unsigned long *,unsigned long *, unsigned long);
extern BOOL dsk6x_hpi_fill(dskHANDLE ,unsigned long,unsigned long *,unsigned long);
extern BOOL dsk6x_hpi_generate_int(dskHANDLE );
extern int dsk6x_coff_load(dskHANDLE ,char *, BOOL, BOOL, BOOL); #ifdef __cplusplus
}
#endif /* End of DSK Function Prototypes */