"Could not open OSO file" - iOS Release Build

Right now my app builds fine when running a debug build but as soon as I try and run a release build I get a ton of warnings saying "Could not open fork matching current architecture for OSO archive “filename.a”. The app then crashes when trying to load a UIImage in line 206 of ofPixels.cpp.

Example below:

  
  
warning: Could not open fork matching current architecture for OSO archive "/Users/admin/Source/github/RGBlaster/of_preRelease_v007_iphone/apps/builds/RGBlaster/../../../libs/freetype/lib/iphone/freetype.a"  
warning: Could not open OSO file /Users/admin/Source/github/RGBlaster/of_preRelease_v007_iphone/apps/builds/RGBlaster/../../../libs/freetype/lib/iphone/freetype.a(ftbase.o) to scan for pubtypes for objfile /Users/admin/Library/Developer/Xcode/DerivedData/RGBlaster-gnyuntlubjefunelnaacyybmvuue/Build/Products/Release-iphoneos/RGBlaster.app/RGBlaster  
warning: Could not open fork matching current architecture for OSO archive "/Users/admin/Source/github/RGBlaster/of_preRelease_v007_iphone/apps/builds/RGBlaster/../../../libs/freetype/lib/iphone/freetype.a"  
warning: Could not open OSO file /Users/admin/Source/github/RGBlaster/of_preRelease_v007_iphone/apps/builds/RGBlaster/../../../libs/freetype/lib/iphone/freetype.a(ftinit.o) to scan for pubtypes for objfile /Users/admin/Library/Developer/Xcode/DerivedData/RGBlaster-gnyuntlubjefunelnaacyybmvuue/Build/Products/Release-iphoneos/RGBlaster.app/RGBlaster  
  

Any ideas why this might be happening? Incorrect linking to the libs folder? The OSO warning is thrown for pretty much every .a file in the libs folder. Any help or insight would be appreciated.

Update!

Right now I’m compiling with Apple LLVM 3.0 (default compiler). By switching Generate Debug Symbols to ‘Yes’ for my release build I got rid of all the OSO warnings. However my code still errors out in ofPixels.cpp. I can comment out the line that calls the function which causes the error but then my colors in the app are all mixed up… so still searching for a solution. I’ll update this post again if I figure out how to fix it.

Update #2:
Still not sure why it was happening but I fixed the ofPixels error. I was loading 3 large .png ofImages from a setup() function and it was erroring out in the swaprgb line on the first image. I replaced the entire swaprgb function with the code found in this post: http://forum.openframeworks.cc/t/runtime-error-opencvhaarfinderexample/8827/2

  
  
    template<typename PixelType>    
    void ofPixels_<PixelType>::swapRgb(){    
        if (channels >= 3){    
            int sizePixels = width*height*channels;    
            for (int i=0; i< sizePixels; i+=channels){    
                std::swap(pixels[i],pixels[i+2]);    
            }    
        }    
    }    
  

And now everything works great. An explanation of why these errors were happening would be great but I’m just glad everything is working now. Posted this update in case others run into similar problems and are desperately googling for a solution like I was.

your solution:

solved this issue in my project:

thanks for posting, you have put an end to a 10 hours long debugging session :wink: