问题:
头文件:
#ifndef YgomiArabicTool_h
#define YgomiArabicTool_h
#include <wtf/Vector.h>
#include <wtf/unicode/Unicode.h>
namespace WebCore {
class String;
class YgomiArabicTool {
public:
void test();
//static int test();
};
}
#endif
cpp文件:
#include "config.h"
#include "YgomiArabicTool.h"
#include "PlatformString.h"
#include <wtf/StringExtras.h>
namespace WebCore {
void YgomiArabicTool::test(){
}
}
在另一个类的函数里调用:
YgomiArabicTool* my = new YgomiArabicTool();
my->test();
实际编译结果:
/home/liuxiangfeng/Code/vehiclemw_master/vehiclemw/external/webkit/WebCore/loader/ResourceLoader.cpp:309: undefined reference to `WebCore::YgomiArabicTool::test()'collect2: ld returned 1 exit status
是链接错误,没有生成YgomiArabicTool.o文件。需要在makefile里加上这个文件。