-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
【结构体中调用XTOSTRUCT失败】 #2
Comments
能简单贴一下结构体定义的代码吗? |
嗯嗯
|
struct StuCommonReturnedInfo |
代码跟进去显示的是 X_STRUCT_WRAP_L1, TOX_, TOS_, TOG_ 这四个宏定义找不到哎 |
那有点奇怪了,我这是能运行的: #include <iostream>
#include <x2struct.hpp>
using namespace std;
struct StuCommonReturnedInfo
{
std::string cmdOld;
std::string status;
std::string result;
XTOSTRUCT(M(cmdOld, status, result));
};
int main(int argc, char *argv[]) {
StuCommonReturnedInfo info;
info.cmdOld = "hello";
info.status = "good";
info.result = "nice";
cout<<x2struct::X::tojson(info)<<endl;
return 0;
} 运行的结果是: {"cmdOld":"hello","status":"good","result":"nice"} g++的版本是: |
你是不是用的VC?这个没在VC上验证过,你可以加QQ群878041110,我看看怎么改 |
对的,用的是vc,我加一下哈~谢谢 |
加了哈 |
已支持VS |
你好:
我在声明的结构体中调用了XTOSTRUCT,但是报错了。提示宏定义TOX_ 和 X_STRUCT_L1是未声明的标识符。代码跟进去文件x2struct.hpp,果然没有找到这两个宏定义。宏定义TOS_也没有找到。
这是怎么回事啊?
The text was updated successfully, but these errors were encountered: