此声明没有存储类或类型说明符

时间:2014-02-09 04:26:51

标签: c++ dll export

在实现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;

}    

任何人都知道为什么?感谢。

1 个答案:

答案 0 :(得分:0)

我发现它,它是外部的下划线。

应该是

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

而不是

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

感谢。

相关问题