2014-02-09 62 views
0

我有一个此声明没有存储类或类型说明符执行C++ dll时的问题。下面是代码此声明没有存储类或类型说明符

CarPool.h代码:

#pragma once 
#define DllExport _extern "C" long __declspec(dllexport) 

DllExport CartToPol(char* fileName, long imgWidth, long imgHeight, long bytePerPixel); 
DllExport PolToCart(char* fileName, long imgWidth, long imgHeight, long bytePerPixel); 

CarPool.cpp代码

// CarPool.cpp : Defines the exported functions for the DLL application. 
    // 

    #include "stdafx.h" 
    #include "CarPool.h" 

    DllExport CartToPol(char* fileName, long imgWidth, long imgHeight, long bytePerPixel) 
    { 
     return TRUE; 
    } 

DllExport PolToCart(char* fileName, long imgWidth, long imgHeight, long bytePerPixel) 
{ 
    return TRUE; 

}  

任何人有任何想法,为什么?谢谢。

回答

0

我发现它,它是extern下划线。

应该

#define DllExport extern "C" long __declspec(dllexport) 

,而不是

#define DllExport _extern "C" long __declspec(dllexport) 

感谢。