Mac 10.14.2,Xcode 10.1,cocos2dx 3.17,编译到Mac
一晚上一直在出linker command failed的错误,然后以为是什么文件重复引用,新建工程还是出错。
然后慢慢定位问题,发现只要一执行自己写的类的函数就出错。
Classes下有Test.hpp:
#ifndef Test_hpp
#define Test_hpp
#include <stdio.h>
class Test{
public:
void add();
};
#endif
然后Test.cpp:
#include “Test.hpp”
public void Test::add(){
return ;
}
然后!在AppDelegate.cpp的director->runWithScene(scene);之前加入Test * test = new Test();能够正常编译
但是!一但加入test->add();
然后这个熟悉的错误就产生了:
linker command failed with exit code 1(use -v to see invocation)
编译到ios正常,编译到mac一执行自定义类的函数就这个错误。。