ofxGuiExample is not working in iOS

When I build the ofxGuiExample for iOS, I get the following error
How can I fix this?

Undefined symbol: ofxSlider::ofxSlider(ofParameter, float, float)

Undefined symbols for architecture arm64:
“ofxSlider::ofxSlider(ofParameter, float, float)”, referenced from:
std::__1::unique_ptr<ofxSlider, std::__1::default_delete<ofxSlider > > std::make_unique_helper<ofxSlider, ofParameter&, float&, float&>(std::__1::integral_constant<bool, false>, ofParameter&, float&, float&) in ofxGuiGroup.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

The development environment is
Xcode 12.4
macOS Catalina 10.15.7

can you please post the code you are using?
Please do it inline rather than uploading files.
just paste the code in the text box, select it all and press the </> button that it is on the top of the textbox.

I used the following code.

void ofApp::setup(){	

	// we add this listener before setting up so the initial circle resolution is correct
	circleResolution.addListener(this, &ofApp::circleResolutionChanged);

	// change default sizes for ofxGui so it's usable in small/high density screens

	gui.setup("panel"); // most of the time you don't need a name but don't forget to call setup
	gui.add(filled.set("bFill", true));
	gui.add(radius.set( "radius", 140, 10, 300 ));
	gui.add(circleResolution.set("circleRes", 5, 3, 90));
	gui.add(screenSize.set("screenSize", ofToString(ofGetWidth()) + "x" + ofToString(ofGetHeight())));
	bHide = true;


    //screenSize = ofToString(w) + "x" + ofToString(h);

void ofApp::circleResolutionChanged(int & circleResolution){

void ofApp::ringButtonPressed(){

void ofApp::update(){


void ofApp::draw(){
    ofBackgroundGradient(ofColor::white, ofColor::gray);
	if( filled ){

		ofDrawCircle(center->x-radius*.5, center->y, radius );
		ofDrawCircle(center->x+radius*.5, center->y, radius );
		ofDrawCircle((glm::vec2)center, radius );
	if( bHide ){

void ofApp::exit(){

I built this project without any changes.

I dont have your xcode version in order to check it.

did you update the example with project generator before trying to compile?
Open Project generator and just drag and drop into it the folder of the example.

On Xcode, on the left side panel, find and select ofxSlider.cpp. Then look in the right side panel, in the Target membership section if it is checked for your project. if not check it and recompile.

ok. so it has nothign to do with what I mentioned before. Apparently it is a bug, but easy to fix.
open ofxSlider.cpp scroll all the way to the bottom and comment out the line that reads //#ifdef TARGET_OSX and the line that reads //#endif

It should look like this

//#ifdef TARGET_OSX
template class ofxSlider<typename std::conditional<std::is_same<uint32_t, size_t>::value || std::is_same<uint64_t, size_t>::value, bool, size_t>::type>;

do the same thing in ofxInputField.cpp, which you should leave looking like the following

//#ifdef TARGET_OSX
template class ofxInputField<typename std::conditional<std::is_same<uint32_t, size_t>::value || std::is_same<uint64_t, size_t>::value, bool, size_t>::type>;

Last, follow the screenshot

Let me know if this works.
I will push a fix for this.

1 Like

It worked that way.
Thank you for your help!

1 Like

Thank you. I have been testing UIs for an app and can confirm that the error is gone and the project runs as expected.

EDIT: never mind the rest of the post, same issue here: Addon suggestion for input text field on iOS13

As I was testing it I noticed that the screenSize ofParameter behaves like a text input field but as it gains focus the iOS keyboard doesn’t show up. I added a text input field to confirm it, and the same occurs. I tried to add a listener as showed in How to enter text in ofxGui?. I haven’t finished yet - a bug crept in - but I think that the keyboard showing up should precede the listening event, no?

Thanks again.