errors compiling the latest git iphone version

Hello:
I am trying to compile the empty example included on the newest iphone/git version. However i am getting the next two errors:

error: ‘glColorMaterial’ was not declared in this scope

and

error: no matching function for call to ‘ofAddListener(ofEvent&, testApp*&, )’

the first error comes from the implementation of “ofLight.h”
the second seems to come from this template from the ‘ofEvents.h’:
template
void ofRegisterTouchEvents(ListenerClass * listener){
ofAddListener(ofEvents.touchDoubleTap, listener, &ListenerClass::touchDoubleTap);
ofAddListener(ofEvents.touchDown, listener, &ListenerClass::touchDown);
ofAddListener(ofEvents.touchMoved, listener, &ListenerClass::touchMoved);
ofAddListener(ofEvents.touchUp, listener, &ListenerClass::touchUp);
ofAddListener(ofEvents.touchCancelled, listener, &ListenerClass::touchCancelled);
}

any ideas where this problems might come from?

I am on a mac, OSX 10.6.6, xcode 3.2.5

thanks!

-emmanuel

the git branch is a super moving target during our dev week where we have been hacking at the core (breaking and fixing platforms as we go) – you might try to branch again, I know it’s working on iphone, but not all examples might be up to date, so you’ll have to poke around… Otherwise, we should have master back in order in the next week or so. In the meantime, 0.062 should always work…

  • zach

hey Zach:
thanks for the reply, I will keep a close look into the development the coming days(I have noticed the huge amount of changes on the github project), looking forward.

About the preRelease_v0062: i am running on xcode 3.2.5. The standard examples are requiring the 4.1 SDK(I have the 4.2 running because of the xcode version).
That is always the issue with the iPhone, it feels that you are running trying to catch the hare(i heard that the SDK 4.3 beta is already downloadable!).
It would be very useful to know which sdk is being used or, even more, have projects for each one of the sdk(if that is possible).

Thanks again

-emmanuel

Hi emmanuel,

you should be able to compile 0.062 w/ iOS 4.2 – but you have to adjust the settings in the project… here’s what to do:

a) in the project you are compiling, do project -> edit project settings -> base SDK -> set to 4.2 (do this for all configurations)
b) check the same for active target settings
c) open up the openframeworks lib project (on the side bar, double click on openFrameworks ->iPhone+OF Lib.xcodeproj)
d) do step (a) for that project (which builds the OF library).
e) in the project, set the active configuration (or in the menu “active build configuration”) to release (or just alter the active configuration) as this tends to snap out of the “base sdk missing” at the top bar of the IDE, and allows you to choose device / simulator, etc.

I hope this helps!
zach

Hey Zach:
thanks for the help. I did as suggested on your post and the example compiles now. however, when i want to run it the console throws the next errors:
2011-01-17 08:19:54.850 emptyExample[5445:207] Creating OpenGL ES2 Renderer
2011-01-17 08:19:54.917 emptyExample[5445:207] Failed to load vertex shader
2011-01-17 08:19:54.918 emptyExample[5445:207] Failed to compile vertex shader
2011-01-17 08:19:54.919 emptyExample[5445:207] OpenGL ES2 failed
2011-01-17 08:19:54.968 emptyExample[5445:207] Creating OpenGL ES1 Renderer

any ideas?

Hello,

Same problem as efe here. The iphone emptyExample (and other iPhone examples) does not compile.

The second error is easy to fix. A touchCancelled() function has been added to class ofCoreEvent, so you have to add it to your testApp class as well (just duplicate another touchXXX function and rename it to touchCancelled).

The first error:

openFrameworks/libs/openFrameworksCompiled/project/iphone/…/…/…/openFrameworks/3d/ofLight.cpp:17: error: ‘glColorMaterial’ was not declared in this scope

is still blocking me. I can of course comment the call to the missing function (but that’s not really the good solution) to have the iPhone+OF Static Library compile, but then there is the next error:

CppUnit.a is missing (in red in files list) and the linker complains for it.

Has this file been removed intentionally ? Removing it from the projet leads to more missing functions during the link.

Would it be possible for an OF guru to fix at least the (iphone) emptyExample ?

Thank you.

(Using github current master branch with Xcode 3.2.5 on OS X 10.6.6)

I also try to fix and get the iphone emptyExample app running but fail, cant wait!

  • rS

I did a git pull today, and the iphone emptyExample app compile!

All I did was:
1- Add the touchCancelled() method
2- Uncheck the CppUnit frameworks

Cheers

  • rS

hi,

I tried the steps that you described in this thread, but I’m getting this error when I try to compile one of the examples:

No matching function for call to ‘ofAddListener(ofEvent&, testApp*&, )’

I’m using Xcode 3.2.5 and the latest Github version 06.2

any ideas?

thanks!

  • maria

I also get this. Not sure on the fix yet but looking into it.

Ok the fix I’ve found. Make sure your testApp instantiates the touchCancelled function. Then, go into ofEvents, around line 172:

  
  
template<class ListenerClass>  
	void ofRegisterTouchEvents(ListenerClass * listener){  
		  
		ofEvents.touchDoubleTap += Poco::delegate(listener, &ListenerClass::touchDoubleTap);  
		ofEvents.touchDown += Poco::delegate(listener, &ListenerClass::touchDown);  
		ofEvents.touchMoved += Poco::delegate(listener, &ListenerClass::touchMoved);  
		ofEvents.touchUp += Poco::delegate(listener, &ListenerClass::touchUp);  
		ofEvents.touchCancelled += Poco::delegate(listener, &ListenerClass::touchCancelled);  
		  
		/*ofAddListener(ofEvents.touchDoubleTap, listener, &ListenerClass::touchDoubleTap);  
		ofAddListener(ofEvents.touchDown, listener, &ListenerClass::touchDown);  
		ofAddListener(ofEvents.touchMoved, listener, &ListenerClass::touchMoved);  
		ofAddListener(ofEvents.touchUp, listener, &ListenerClass::touchUp);  
		ofAddListener(ofEvents.touchCancelled, listener, &ListenerClass::touchCancelled);*/  
	}  
  

The commented bit is the original code, with my replacements above. There are two versions of ofAddListener and I don’t know why they are there but damn, its overly complicated and there really is no need for it (i’ve no idea how it could possibly work in the first place but nevermind).

Now there are lots of linker errors :S

Ok, so I’ve managed to get a lot of this sorted. It builds and installs but sadly, doesn’t actually run. The error in the simulator is:

Detected an attempt to call a symbol in system libraries that is not present on the iPhone:
pthread_mutexattr_destroy$UNIX2003 called from function _ZN4Poco9MutexImplC2Eb in image emptyExample.
If you are encountering this problem running a simulator binary within gdb, make sure you ‘set start-with-shell off’ first.

Now I believe this is because the pocolibs are not compiled for iOS 4.2 thanks to reading this thread:
http://www.un4seen.com/

So I reckon a rebuild of poco for the simulator might work. Dunno if people agree.

In fact, yes it does! Working example seems to be good. If anyone else has issues, hit me up.

Damn, I’m struggling with this, too. I implement the touchCancelled listener and always get the following:

…/…/…/libs/openFrameworks/events/ofEventUtils.h:39:0 …/…/…/libs/openFrameworks/events/ofEventUtils.h:39: error: no match for ‘operator+=’ in ‘event += Poco::delegate(TObj*, void (TObj::*)(TArgs&)) with-TObj-=-testApp,-TArgs-=-ofTouchEventArgs

Which seems to be similar to the error message named above. What the hell is going on here? I don’t even NEED the TouchCancelled function, but it prevents my entire project from compiling.

The current master branch from git doesnt work with iOS, but there is a pull request #542 that fix all compatibility issues

Quick fix for this error:

  
  
pthread_mutexattr_destroy$UNIX2003 called from function _ZN4Poco9MutexImplC2Eb in image emptyExample.  
  

Get the libs/poco folder from 0062, and swap them into your 007, then try to compile. You’ll get an error here

  
  
bool ofFile::isDevice() const{  
	return myFile.isDevice();  
}  
  

Change it to

  
  
bool ofFile::isDevice() const{  
	//return myFile.isDevice();  
	return false;  
}  
  

It’s a hack, but it might help if you need to get on with it!