如何在我的cpp程序中使用这个宏
How to use this macro in my cpp program?
我有以下宏与我。我得到错误,而使用这个宏。如果你观察到schema::schema()
没有结束括号。这是我的宏头文件。
#ifdef _WINDOWS_SOURCE
#define ExportedByVX0TOOLS __declspec(dllexport)
#else
#define ExportedByVX0TOOLS
#endif
#include <stdio.h>
#include <string.h>
//
#if defined(_WINDOWS_SOURCE)
#include <errno.h>
#include <io.h>
#endif
#if defined(_IRIX_SOURCE) || defined(_SUNOS_SOURCE) || defined(_HPUX_SOURCE) || defined(_AIX)
#include <stdlib.h>
#include <sys/stat.h>
#include <unistd.h>
#endif
#define LoadSchemaDico(schema)
class ExportedByVX0TOOLS schema { public: schema();};
extern "C" ExportedByVX0TOOLS int fctCreate##schema();
int fctCreate##schema(){ int ret=1 ; return ret; }
schema::schema(){
你可以这样使用:
LoadSchemaDico(name)
//constructor code
}
展开为:
class ExportedByVX0TOOLS name
{
public:
name();
};
extern "C" ExportedByVX0TOOLS int fctCreatename();
int fctCreatename()
{
int ret=1 ;
return ret;
}
name::name()
{
//constructor code
}
相关文章:
- 当我在main中声明了我的2d数组时,为什么我的程序会退出
- 为什么我的 IExtractIcon 处理程序没有被调用?
- 为什么我的程序在for循环中k=0时返回垃圾值
- 为什么它只打印双链接列表的第一个值,而我的程序却崩溃了
- 我的程序没有从文件中读取并输入数据
- 我的评分程序无法正常工作
- 为什么我的C++程序的程序集输出充满了 .ascii,没有汇编代码?
- 我的程序有一个保存配置文件的GUI,如何双击此配置文件以直接加载带有配置数据的GUI?
- 我的目标是编写一个程序来计算和存储字符串在字符数组中出现的位置
- 反向功能超出了我的 cpp 程序的范围
- 我的二进制搜索程序只是关闭了
- 为什么我的程序不能显示斐波那契级数?
- 为什么我的程序在使用预留后没有加速?
- 为什么如果我添加这一行,我的程序会不断询问值
- 为什么当我输入较大的数字时,我的程序会到达文件末尾?
- 为什么我的两个 cin 语句没有在程序结束时运行?
- 这是使用回溯的 nqueen 问题,但我使用了动态 2d 数组,我的程序编译良好,但不返回任何输出
- 为什么我的程序在 O0 和 O2 的优化级别返回不同的结果
- C++机器人程序(我的私人服务器)出现问题
- 用C++创建一个写作应用程序(我的第一个项目)(学习C++)