请看如下代码:#include <stdio.h>
#define FUNC_EXPORT __declspec( dllimport )
#include "BaseHSM.h"__declspec( dllimport ) int WINAPI TASS_EncryptFile(char *inPath,char *outPath,char *keyFile);
__declspec( dllimport ) int WINAPI TASS_DecryptFile(char *inPath,char *outPath,char *keyFile);void jmFile(){int rv = 0;
unsigned char keyBuf[3000],inData[3000],outData[3000],temp[3000];
int keyLen,inLen,outLen,tempLen; unsigned char handle[20]; //GetTransEncryptFilePath((char*)keyBuf); rv = FUNC_InitDevice();
printf("设备初始化失败\n");
if(rv != 0) {
return ; 
}
#if 1编译时出现如此错误请问如何解决呢?Compiling...
jmFile.cpp
e:\test\jmfile.cpp(7) : error C2146: syntax error : missing ';' before identifier 'TASS_EncryptFile'
e:\test\jmfile.cpp(7) : fatal error C1004: unexpected end of file found
Error executing cl.exe.test.exe - 2 error(s), 0 warning(s)请各位大侠帮忙看一下是什么原因叫?

解决方案 »

  1.   

    int __declspec( dllimport ) WINAPI TASS_EncryptFile(char *inPath,char *outPath,char *keyFile); 这样呢
      

  2.   

    WINAPI需要#include <windows.h>吧
    把它替换成__stdcall试试
      

  3.   

    WINAPI 换成__stdcall
    包含"stdafx.h"
      

  4.   

    同 2L,从迹象看 WINAPI 没有定义
      

  5.   

    看看这个了,http://blog.csdn.net/na_he/archive/2008/05/07/2408655.aspx希望全面地了解DLL的相关知识了,呵呵!
      

  6.   

    在<stdio.h>后添加
    #include <windows.h>
    WINAPI宏可能在windows或其相关的头文件中定义的