Help trying to run master branch

I’ve been using 0.8.4 for some time now but have been running into some errors like orientation fixes in iOS 8 and similar issues that are fixed in master branch but not in the 0.8.4 version. Though, when I try to run with the master branch I get some errors I have no idea how to solve. Can someone help? Thanks!

Here they are:

Undefined symbols for architecture i386:
  "ofSetupOpenGL(int, int, ofWindowMode)", referenced from:
      _main in main.o
  "ofSoundBuffer::operator[](unsigned long)", referenced from:
      ofBaseSoundInput::audioIn(ofSoundBuffer&) in ofApp.o
      ofBaseSoundOutput::audioOut(ofSoundBuffer&) in ofApp.o
      ofBaseSoundInput::audioIn(ofSoundBuffer&) in main.o
      ofBaseSoundOutput::audioOut(ofSoundBuffer&) in main.o
  "ofImage_<unsigned char>::getTexture()", referenced from:
      vtable for ofxImage in ofApp.o
      construction vtable for ofImage_<unsigned char>-in-ofxImage in ofApp.o
      vtable for ofxImage in main.o
      construction vtable for ofImage_<unsigned char>-in-ofxImage in main.o
  "ofImage_<unsigned char>::getTexture() const", referenced from:
      vtable for ofxImage in ofApp.o
      construction vtable for ofImage_<unsigned char>-in-ofxImage in ofApp.o
      vtable for ofxImage in main.o
      construction vtable for ofImage_<unsigned char>-in-ofxImage in main.o
  "ofImage_<unsigned char>::isUsingTexture() const", referenced from:
      vtable for ofxImage in ofApp.o
      construction vtable for ofImage_<unsigned char>-in-ofxImage in ofApp.o
      vtable for ofxImage in main.o
      construction vtable for ofImage_<unsigned char>-in-ofxImage in main.o
  "ofImage_<unsigned char>::draw(float, float) const", referenced from:
      vtable for ofxImage in ofApp.o
      construction vtable for ofImage_<unsigned char>-in-ofxImage in ofApp.o
      vtable for ofxImage in main.o
      construction vtable for ofImage_<unsigned char>-in-ofxImage in main.o
  "ofImage_<unsigned char>::draw(float, float, float, float) const", referenced from:
      vtable for ofxImage in ofApp.o
      construction vtable for ofImage_<unsigned char>-in-ofxImage in ofApp.o
      vtable for ofxImage in main.o
      construction vtable for ofImage_<unsigned char>-in-ofxImage in main.o
  "ofImage_<unsigned char>::getWidth() const", referenced from:
      vtable for ofxImage in ofApp.o
      construction vtable for ofImage_<unsigned char>-in-ofxImage in ofApp.o
      vtable for ofxImage in main.o
      construction vtable for ofImage_<unsigned char>-in-ofxImage in main.o
  "ofImage_<unsigned char>::getHeight() const", referenced from:
      vtable for ofxImage in ofApp.o
      construction vtable for ofImage_<unsigned char>-in-ofxImage in ofApp.o
      vtable for ofxImage in main.o
      construction vtable for ofImage_<unsigned char>-in-ofxImage in main.o
  "ofImage_<unsigned char>::getPixels() const", referenced from:
      vtable for ofxImage in ofApp.o
      construction vtable for ofImage_<unsigned char>-in-ofxImage in ofApp.o
      vtable for ofxImage in main.o
      construction vtable for ofImage_<unsigned char>-in-ofxImage in main.o
  "non-virtual thunk to ofImage_<unsigned char>::getTexture()", referenced from:
      vtable for ofxImage in ofApp.o
      vtable for ofxImage in main.o
  "non-virtual thunk to ofImage_<unsigned char>::getTexture() const", referenced from:
      vtable for ofxImage in ofApp.o
      vtable for ofxImage in main.o
  "non-virtual thunk to ofImage_<unsigned char>::isUsingTexture() const", referenced from:
      vtable for ofxImage in ofApp.o
      vtable for ofxImage in main.o
  "non-virtual thunk to ofImage_<unsigned char>::getPixels() const", referenced from:
      vtable for ofxImage in ofApp.o
      construction vtable for ofImage_<unsigned char>-in-ofxImage in ofApp.o
      vtable for ofxImage in main.o
      construction vtable for ofImage_<unsigned char>-in-ofxImage in main.o
ld: symbol(s) not found for architecture i386

I think those are all new functions from 0.9.0. I’d guess what’s going on here is that you’re getting the new headers, but compiling with the old .cpp files? It’s hard to guess exactly what the issue is, but it’s probably related to your folder / path structure or something like that.

How did you go about migrating your project to the git master?

Mh… That makes sense!

About the migration, I basically have a folder with the openFrameworks git repo in which I had a branch checked out to 0.8.4 and that was the one I was using and was/is fully working. So, I checked out to master and updated it. Am I missing something?

I’ve tried cleaning and rebuilding the project in Xcode, though the errors persist. I “got rid” of most of the ofxImage image errors, since I was using a custom ofxImage class and I guess that master might have some class like that defined somewhere. Still the following ones still persist:

Undefined symbols for architecture i386:
  "ofSoundBuffer::operator[](unsigned long)", referenced from:
      ofBaseSoundInput::audioIn(ofSoundBuffer&) in ofApp.o
      ofBaseSoundOutput::audioOut(ofSoundBuffer&) in ofApp.o
  "ofSetupOpenGL(int, int, ofWindowMode)", referenced from:
      _main in main.o
  "ofImage_<unsigned char>::draw(float, float, float, float) const", referenced from:
      ofApp::draw() in ofApp.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I don’t really understand the ofSoundBuffer one, since I’m not defining any audioIn() or audioOut() method.

Any other ideas? Thanks!

I think architectures setting of xcode is 64bit.
You need to change the setting to i386.

The ofSoundBuffer stuff is because that’s a new class in 0.9.0. While you’re not using it directly, you’ll still be compiling some classes which have references to ofSoundBuffer.

Again, this makes it sound like (for some reason) Xcode isn’t compiling all the new .cpp files in OF. What do you see in Xcode when you expand openFrameworks/iOS+OFLib.xcodeproj/openFrameworks/sound ? It should be like this (note ofSoundBuffer):

You’re totally right. I don’t get the ofSoundButter files there. I think this is somewhat related with Xcode not automatically considering files that haven’t been added through its interface, even though they are in the filesystem. Am I making myself clear? Like in Eclipse you can refresh the project and files that have been added through the filesystem to the project structure appear in the IDE whereas the same doesn’t happen with Xcode. Any idea how to go about it?

I ran in to the same error trying to compile the latest master branch.

I’ve fixed it by setting the architecture to $(NATIVE_ARCH).

On Build Settings > Architectures > Other... type $(NATIVE_ARCH)

(Just posted the same find out on this thread)

[edit]

Also, on Build Phases > Link Binary With Libraries I was missing all the necessary frameworks. So, just add them.

1 Like

Thanks so much @xavivives and for posting here the info too! I’ve just managed to run it with no problems now.

1 Like