ofxFenster issues GL callback : glfwSetKeyCallback, glfwSetDropCallback, ofSetupOpenGL' is ambiguous

Are these issues known ?
I’m on OSX 10.9.4 and openFrameworks nightly build.

My lovely favourite ofxFenster does not compile any more…

/Users/dudleysmith/Dude_s_Place/_OF/openFrameworks/addons/ofxFenster/src/ofxFenster.cpp:272:2: No matching function for call to ‘glfwSetKeyCallback’

/Users/dudleysmith/Dude_s_Place/_OF/openFrameworks/addons/ofxFenster/src/ofxFenster.cpp:276:2: No matching function for call to ‘glfwSetDropCallback’
@this place : ofxFenster.cpp

void ofxFenster::initializeWindow(){
	 // setup the callbacks
	glfwSetMouseButtonCallback(windowP, ofxFensterManager::mouse_cb);
	glfwSetCursorPosCallback(windowP, ofxFensterManager::motion_cb);
	//Issue on it : glfwSetKeyCallback(windowP, ofxFensterManager::keyboard_cb);
	glfwSetWindowSizeCallback(windowP, ofxFensterManager::resize_cb);
	glfwSetWindowCloseCallback(windowP, ofxFensterManager::exit_cb);
	glfwSetScrollCallback(windowP, ofxFensterManager::scroll_cb);
    //Issue on it : glfwSetDropCallback(windowP, ofxFensterManager::drop_cb);


and this also :

call to ‘ofSetupOpenGL’ is ambiguous
@this place : ofxFensterManager.cpp

void ofxFensterManager::setup(int w, int h, int screenMode) {
	ofxFensterManager* manager = get();
	ofSetupOpenGL(manager->getMainWindow(), w, h,OF_WINDOW);			// <-------- setup the GL context

Cheers and support
D. Smith

this is probably related


Yes, it can.
For sure, i’m not the author of the addon and I did not finish my book about openGL,
but it seems that ofxFenster is derivated from ofAppBaseWindow, so it should go into ofSetupOpenGL.

class ofxFenster : public ofAppBaseWindow, public ofBaseApp

and getMainWindow returns some “pointer” of ofxFenster

ofxFensterPtr ofxFensterManager::getMainWindow()
    return mainWindow;

Main window is declared as is :

typedef ofPtr<ofxFenster> ofxFensterPtr;

ofxFensterPtr mainWindow;

that does not explain why it is ambiguous, those two calls seem different, it could do the choice…

void 		ofSetupOpenGL(shared_ptr<ofAppBaseGLESWindow> windowPtr, int w, int h, int screenMode);	// sets up the opengl context!
void 		ofSetupOpenGL(ofAppBaseGLESWindow * windowPtr, int w, int h, int screenMode);  // will be deprecated

Another question, is there a ofCore way to do multi-windows ?

Do I have to choose between those two derivated classes ?

class ofAppBaseGLWindow: public ofAppBaseWindow{
	virtual ~ofAppBaseGLWindow(){}
	virtual void setOpenGLVersion(int glVersionMajor,int glVersionMinor){};

class ofAppBaseGLESWindow: public ofAppBaseWindow{
	virtual ~ofAppBaseGLESWindow(){}
	virtual void setGLESVersion(int glesVersion){};

Did you manage to solve the glfwSetKeyCallback and glfwSetDropCallback issues?

They fit the function signatures and all of the other callbacks work so I’ve also got no idea whats breaking or how to go about fixing it

Fixed these issues here - https://github.com/sheridanis/ofxFenster/commit/36599e3f859fced1c649667073c88c04cce6baa6

The function signatures in the online documentation hadn’t been updated to reflect the actual code

Hi @jrs,

Thanks for fixing, I’m including your fork and I got new bugs.
Type ofAppBaseGLWindow does not exist anywhere in the framework

/Users/dudleysmith/Dude_s_Place/_OF/0.8.4/addons/ofxFenster/src/ofxFenster.h:21:27: Unknown class name 'ofAppBaseGLWindow'; did you mean 'ofAppBaseWindow'?

Error from inheritance declaration in those type of lines.

class ofxFenster : public ofAppBaseGLWindow, public ofBaseApp

Could you help a little more ?


Thx for opening this thread. Having the same issues (on OS X 10.8.).

To be sincere, I gave up and switch to ofxMultiGLFWWindow
Ready to test if needed.

Her a fork with all the fixing:


now compiling without errors

@n3m3da with the current master I get

 ofxFensterManager.cpp:38:60:   required from here
 error: request for member ‘setup’ is ambiguous     windowPtr->setup(settings); 

any ideas?

I already fixed some issues related to ofWindowMode and some ofNotify changes here: https://github.com/ixds/ofxFenster/tree/develop

Did you use my fork; https://github.com/d3cod3/ofxFenster ?

Can you post more info about the error?

I have my fork with of 0.8.4 up & running…

Ok, thanks. I’ll test it with 0.8.4.

Was trying to get it running under the current master (0.9.?). The error kind of means, that the compiler can’t tell which setup() it should call. The windowPtr is pointing to an ofxFenster, which inherits from different classes (ofBaseApp, ofAppGLFWWindow)

In file included from ../../../addons/ofxFenster/src/ofxFensterManager.cpp:2:0:
../../../libs/openFrameworks/app/ofAppRunner.h: In instantiation of ‘void ofSetupOpenGL(std::shared_ptr<_Tp1>, int, int, ofWindowMode) [with Window = ofxFenster]’:
../../../addons/ofxFenster/src/ofxFensterManager.cpp:38:60:   required from here
../../../libs/openFrameworks/app/ofAppRunner.h:32:2: error: request for member ‘setup’ is ambiguous
In file included from ../../../addons/ofxFenster/src/ofxFenster.h:16:0,
                 from ../../../addons/ofxFenster/src/ofxFensterManager.h:5,
                 from ../../../addons/ofxFenster/src/ofxFensterManager.cpp:1:
../../../libs/openFrameworks/app/ofBaseApp.h:40:16: note: candidates are: virtual void ofBaseApp::setup(ofEventArgs&)
   virtual void setup(ofEventArgs & args){
../../../libs/openFrameworks/app/ofBaseApp.h:17:16: note:                 virtual void ofBaseApp::setup()
   virtual void setup(){}
In file included from ../../../libs/openFrameworks/app/ofAppGLFWWindow.h:13:0,
                 from ../../../addons/ofxFenster/src/ofxFenster.h:13,
                 from ../../../addons/ofxFenster/src/ofxFensterManager.h:5,
                 from ../../../addons/ofxFenster/src/ofxFensterManager.cpp:1:
../../../libs/openFrameworks/app/ofAppBaseWindow.h:21:15: note:                 virtual void ofAppBaseWindow::setup(const ofWindowSettings&)
  virtual void setup(const ofWindowSettings & settings)=0;
In file included from ../../../addons/ofxFenster/src/ofxFenster.h:13:0,
                 from ../../../addons/ofxFenster/src/ofxFensterManager.h:5,
                 from ../../../addons/ofxFenster/src/ofxFensterManager.cpp:1:
../../../libs/openFrameworks/app/ofAppGLFWWindow.h:130:7: note:                 void ofAppGLFWWindow::setup(const ofGLFWWindowSettings&)
  void setup(const ofGLFWWindowSettings & settings);
../../../libs/openFrameworks/app/ofAppGLFWWindow.h:128:7: note:                 virtual void ofAppGLFWWindow::setup(const ofGLWindowSettings&)
  void setup(const ofGLWindowSettings & settings);

@n3m3da your fork works fine with oF 0.8.4 under ubuntu