简体   繁体   English

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

[英]this declaration has no storage class or type specifier

I have a this declaration has no storage class or type specifier problem when implementing a C++ dll. 实现C ++ dll时,我有一个此声明没有存储类或类型说明符问题。 Here is the code 这是代码

CarPool.h code: 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 code 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;

}    

Anyone has any idea why? 有人知道为什么吗? Thanks. 谢谢。

I found it, it was the underscore on extern. 我找到了,这是extern的下划线。

It should be 它应该是

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

instead of 代替

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

Thanks. 谢谢。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM