Need help with ofxTimeline / openFrameworks 9 build error (Xcode / OSX Sierra)

Hi all,

I am new to openFrameworks and I am trying to get the ofxTimeline addon to compile with openFrameworks 9 using Xcode on OSX Sierra.

The build of ofxTLImageSequence.cpp is failing in ofxTLImageSequence::recomputePreview() method.

This is not the actual code, but psuedo code of what is causing the error:
ofTexture->loadData( ofImage.getPixels(), …)

It seems that ofImage.getPixels() is not returning what ofTexture.loadData() requires and is causing the build error below.

Does any one have any ideas how to fix this?


The build errors:

Projects/openframeworks9/addons/ofxTimeline/src/ofxTLImageSequence.cpp:236:14: No matching member function for call to 'loadData'
Projects/openframeworks9/libs/openFrameworks/gl/ofTexture.h:474:7: Candidate function not viable: no known conversion from 'ofPixels_<unsigned char>' to 'const unsigned char *const' for 1st argument
Projects/openframeworks9/libs/openFrameworks/gl/ofTexture.h:482:7: Candidate function not viable: no known conversion from 'ofPixels_<unsigned char>' to 'const unsigned short *' for 1st argument
Projects/openframeworks9/libs/openFrameworks/gl/ofTexture.h:490:7: Candidate function not viable: no known conversion from 'ofPixels_<unsigned char>' to 'const float *' for 1st argument
Projects/openframeworks9/libs/openFrameworks/gl/ofTexture.h:549:7: Candidate function not viable: requires 3 arguments, but 4 were provided
Projects/openframeworks9/libs/openFrameworks/gl/ofTexture.h:955:10: Candidate function not viable: requires 5 arguments, but 4 were provided
Projects/openframeworks9/libs/openFrameworks/gl/ofTexture.h:520:7: Candidate function not viable: requires 2 arguments, but 4 were provided
Projects/openframeworks9/libs/openFrameworks/gl/ofTexture.h:527:7: Candidate function not viable: requires 2 arguments, but 4 were provided
Projects/openframeworks9/libs/openFrameworks/gl/ofTexture.h:534:7: Candidate function not viable: requires 2 arguments, but 4 were provided
Projects/openframeworks9/libs/openFrameworks/gl/ofTexture.h:494:7: Candidate function not viable: requires single argument 'pix', but 4 arguments were provided
Projects/openframeworks9/libs/openFrameworks/gl/ofTexture.h:502:7: Candidate function not viable: requires single argument 'pix', but 4 arguments were provided
Projects/openframeworks9/libs/openFrameworks/gl/ofTexture.h:510:7: Candidate function not viable: requires single argument 'pix', but 4 arguments were provided

The ofxTLImageSequence::recomputePreview() method:

void ofxTLImageSequence::recomputePreview(){
        ofLogError("ofxTLImageSequence -- hasn't been loaded");

    if(bounds.height < 20){
        ofLogError("ofxTLImageSequence -- too squished at height " + ofToString(20));

    float widthPerFrame = bounds.height/imageHeight * imageWidth;
    int framesToShow = (bounds.width / widthPerFrame) + 1;
    if(framesToShow == 0){
        ofLogError("ofxTLImageSequence -- no frames to show!");

    int startIndex = getIndexAtPercent(zoomBounds.min);
    int endIndex = getIndexAtPercent(zoomBounds.max);
    int framesInRange = (endIndex - startIndex);

    int frameStep = framesInRange / framesToShow;
    int fameIndex = 0;


    for(int i = 0; i < framesToShow; i++){
        ofImage* thumbnail = frames[startIndex+frameStep*i]->getThumbnail();
        PreviewTexture p;
        p.frameIndex = startIndex+frameStep*i;
        p.texture = new ofTexture();
        p.texture->allocate(thumbnail->getWidth(), thumbnail->getHeight(), ofGetGlInternalFormat(thumbnail->getPixelsRef()));

        // *** BUILD IS FAILING HERE *** //
        p.texture->loadData(thumbnail->getPixels(), thumbnail->getWidth(), thumbnail->getHeight(), ofGetGlInternalFormat(thumbnail->getPixelsRef()));

        p.bounds = ofRectangle(widthPerFrame*i, 0, widthPerFrame, bounds.height);

        previewTextures.push_back( p );

Hi! Maybe image.getTexture() instead of image.getPixels() ? Just guessing :slight_smile:

Thanks for the reply @hamoid. I will look into that.

I did more research last night and I think my issue is related to an openFrameworks ofImage update I found on github (see the link below).

I wonder if @arturo might be able to confirm that? It looks like a method was removed that used to return an unsigned char* and now, getPixels returns a raw pointer to pixel data.

I have not seen other posts about the problem I’m having, and I wonder if others have experienced the same build issue?

I used to develop full-time in C++. I now code in Ruby on Rails. It’s been years since I’ve done a deep-dive into C++ pointer issues. So I am trying to get up to speed again. I would appreciate any advice how to resolve this. Do I have to cast the pointer returned by getPixels()?


you can just use ofTexture->loadData( ofImage.getPixels()) as ofImage.getPixels() returns an ofPixels object reference, out of which of texture is able to figure out the rest of the parameters needed to upload the texture.
No need to cast anything.

Hi @roymacdonald, thanks for the reply!

I think that’s what the ofxTimeline code is doing in the ofxTLImageSequence::recomputePreview() method.

Here’s the line of code on GitHub that won’t build. The way I am understanding this is …

First it creates a “thumbnail” object (which is a pointer to an ofImage) as follows …
ofImage* thumbnail = frames[startIndex+frameStep*i]->getThumbnail();

Then, it callsloadData() using getPixels() as the first parameter:
PreviewTexture p; ... p.texture = new ofTexture(); ... p.texture->loadData(thumbnail->getPixels(), thumbnail->getWidth(), thumbnail->getHeight(), ofGetGlInternalFormat(thumbnail->getPixelsRef()));

PreviewTexture is a struct defined as follows…
typedef struct { ofTexture* texture; ofRectangle bounds; int frameIndex; } PreviewTexture;

Here’s a screenshot of the failing Xcode build …

It appears it’s not finding a method signature that matches the parameters being passed in. Namely the pointer to the pixel data returned by the getPixels() method.


Hi, I see. I kinda gave up with ofxTimeline a while ago, so I ended up with a heavily modified version, although I haven’t updated it to 0.9.x.
I’ll give it a try now and I’ll let you know.

Awesome. Thanks so much @roymacdonald!

Just an FYI … I’m using the latest version of openFramewoks … 0.9.8.x i think.

great. are you using the official download or the github master?

Official download from the OF website.

@roymacdonald, I’m leaving work now. I’ll check back here when I get home. Thanks again for your help!

hey so I was able to get it to work using this fork
It needs ofxAudioDecoder
so, I had to remove the ofxAudioDecoder folder in the project navigator and the add it back using the xcode OF plugin menu (if you haven’t installed it you should).
last thing was to change the line you mention above just leaving p.texture->loadData(thumbnail->getPixels();
Sorry for being lazy and not making a new branch, commit,… :stuck_out_tongue:
hope it helps.

1 Like

Excellent! I’ll work on that now and post here later on how I made out.
Thanks @roymacdonald!

Hi @roymacdonald, I was able to get a successful build this morning.

There was a problem building the ofxAudioDecoder. But it was a simple change, updating the AudioDecoderCoreAudio header file. I had to change #ifdef TARGET_OS_IPHONE to #ifdef TARGET_OF_IOS.

As for the OFXcodeMenu plugin … the project builds successfully and I updated the UUID for Xcode Version 8.3, but it still does not display in Xcode. I’ll figure that out eventually. In the meantime the project generator worked for updating the ofxAudioDecoder addon in the ofxTimline project.

Why am I doing all of this? I want to learn about coding video projection mapping apps and learn more about openFrameworks development on OS X. I downloaded the LPMT project and my personal challenge is to get LPMT running on openFrameworks 0.9x and OS X Sierra. So, I will probably be forking more addons to get this to work. ofxTimeline was where I started.

I’m sure I’ll be posting more as I go through this learning process.

Thanks again for your help!

great! I you need help with anything else just ping me.

btw, i think that the OFXcodeMenu plugin is not working on xcode 8 and sierra because of the of apple, as it broke support for almost all plugins. :frowning:

1 Like

Yikes … that stinks. But good to know. Thanks!

Will do. Thanks again!