我在SO上已经阅读了几个有关此问题的问题,但建议的解决方案是进行更新4.我已经安装了update-4 到我的 VS 2012 Ultimate 。但我仍然无法获得UML图。
我的步骤:
为了检查是否还有其他问题,我写了两个类的简单程序。在这个程序中,一个类的变量由第二个类的变量设置。但是没有为以下程序生成UML图。
错误:
Reverse engineer C++ type is not supported. Some DGML node(s) will be skipped during the process. Please see warnings for details.
(0) type(s) fully reverse engineered.
警告:
<Warning Timestamp="2015-09-01T09:45:05" Importance="Medium" Text="Reverse engineer C++ type 'Class1' is skipped." />
<Warning Timestamp="2015-09-01T09:45:05" Importance="Medium" Text="Reverse engineer C++ type 'Class2' is skipped." />
我的代码:
的Class1
#ifndef HEADER1_H
#define HEADER1_H
class Class1 {
private:
int value;
public:
void setValue(int value);
void showValue();
};
#endif
等级2:
#ifndef HEADER_H
#define HEADER_H
#include "Header1.h"
class Class2 {
public:
int secondClassValue;
void setValue(int val);
Class1 *class1;
};
#endif
主():
#include <iostream>
#include "Header1.h"
#include "Header.h"
using namespace std;
void Class1::setValue(int value) {
this->value = value;
}
void Class1::showValue() {
cout<<"The value of second class variable is: "<<this->value<<endl;
}
void Class2::setValue(int val) {
secondClassValue = val;
}
int main() {
Class1 *class1 = new Class1;
Class2 *class2 = new Class2;
class2->setValue(10);
class1->setValue(class2->secondClassValue);
//See the set value
class1->showValue();
delete class1;
delete class2;
return 0;
}