我在 Win32 Dynamic DLL-Link里面想要导出一个类,部分代码如下:
#ifndef STORESCU_H
#define STORESCU_H
//#include"stdafx.h"#define CLASS_STORESCU __declspec(dllexport)
#define MAX_NAME_LENGTH 100
typedef char HOSTNAME[MAX_NAME_LENGTH]class CLASS_STORESCU CStoreScu{
public:
CStoreScu();
~CStoreScu();
BOOL Init(DWORD dwVersion);
BOOL InitializeNetwork();//初始化网络
。
但是报错如下:
Compiling...
storescu.cpp
d:\program\mydcmtk_dll\storescu.h(9) : error C2143: syntax error : missing ';' before '<class-head>'
d:\program\mydcmtk_dll\storescu.h(9) : fatal error C1004: unexpected end of file found
什么问题???????
本人新手,说详细点!!!
#ifndef STORESCU_H
#define STORESCU_H
//#include"stdafx.h"#define CLASS_STORESCU __declspec(dllexport)
#define MAX_NAME_LENGTH 100
typedef char HOSTNAME[MAX_NAME_LENGTH]class CLASS_STORESCU CStoreScu{
public:
CStoreScu();
~CStoreScu();
BOOL Init(DWORD dwVersion);
BOOL InitializeNetwork();//初始化网络
。
但是报错如下:
Compiling...
storescu.cpp
d:\program\mydcmtk_dll\storescu.h(9) : error C2143: syntax error : missing ';' before '<class-head>'
d:\program\mydcmtk_dll\storescu.h(9) : fatal error C1004: unexpected end of file found
什么问题???????
本人新手,说详细点!!!
mfc扩展dll
少个分号,仔细看错误说明。
#define CLASS_STORESCU __declspec(dllexport)最好别这样写死,当外部引用的时候要变成 __declspec(dllimport)一般的写法是:
#ifdef STORESCU_API
#define STORESCU_API __declspec(dllexport)
#else
#define STORESCU_API __declspec(dllimport)
#endif然后在工程设置里的 preprocessor define 项 加上 STORESCU_API