[英]this declaration has no storage class or type specifier
实现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;
}
有人知道为什么吗? 谢谢。
我找到了,这是extern的下划线。
它应该是
#define DllExport extern "C" long __declspec(dllexport)
代替
#define DllExport _extern "C" long __declspec(dllexport)
谢谢。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.