solrex / caffe-mobile

Optimized (for size and speed) Caffe lib for iOS and Android with out-of-the-box demo APP.
Other
317 stars 121 forks source link

Apple Mach-O Linker(Id) Error #7

Closed xqpinitial closed 7 years ago

xqpinitial commented 7 years ago

apple Mach-O Linker(Id) Error caffe::Timer::~Timer() referenced from caffe::CPUTimer::Start() reference from caffe::Net::Net(std::_1::basic_string<char,std::_1::char_traits>...)

the libcaffe.a and libproto.a have been getted in build/lib

solrex commented 7 years ago

@xqpinitial Sorry. I cannot understand your problem. Could you please clean your env, try again and provide more information?

xqpinitial commented 7 years ago

I'm soory i did't make it clear. when i build caffe-mobile lib with cmake for Iphone,there is no problem for cmake and make -j4 however,when i start with xcode to build it by Command-R ,there is a error,Apple Mach-O Linker(Id) Error 03c5a8f3-a061-49c0-9d73-f2c35b29e64a

solrex commented 7 years ago

@xqpinitial It seems like you build caffe-mobile for iPhone, but build CaffeSimple for iPhoneSimulator. Connect your iPhone to Xcode, select one of your "Devices" instead of "iOS Simulators", then Cmd+R. Have fun! ^_^

image

xqpinitial commented 7 years ago

thanks for your answer,but ...i want to cry 2017-04-14 4 59 07

solrex commented 7 years ago

@xqpinitial Right click on the first error, select "Reveal in log" menu. The whole log will be showed in the log message window. Normally this error is introduced by link to a libcaffe.a which is built for another architecture.

For example:

WRONG CASE1: You built CaffeSimple for iPhone, linked to a libcaffe.a(libprotobuf.a) for iPhoneSimulator:

image

WRONG CASE2: You built CaffeSimple for iPhoneSimulator, linked to a libcaffe.a(libprotobuf.a) for iPhone:

image

So please follow the instructions for different target in README.md STEP by STEP, if you don't know how to cleaning up your environment for different targets. It's really important.

xqpinitial commented 7 years ago

Thank you for your patience,I have runing your demo on my mobile with noproblem. I'm sorry i have trouble you. I have never using mac and iphone ,three days ago i try to translate caffe to iphone,i study how to use mac and xcode for one day, and then learn your demo。Because I do not understand the foundation, and bring you the trouble, please also please understand

solrex commented 7 years ago

@xqpinitial Never mind ^_^