[英]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.