Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
Posts: 21
Registered: ‎02-03-2012
My Device: PlayBook 16g
My Carrier: MTSm
Accepted Solution

First SDL app on playbook, builds but does not create a binary.

[ Edited ]
/*This source code copyrighted by Lazy Foo' Productions (2004-2012)
and may not be redestributed without written permission.*/

//Include SDL functions and datatypes
#include "SDL.h"

int main( int argc, char* args[] )
{
    //The images
    SDL_Surface* hello = NULL;
    SDL_Surface* screen = NULL;

    //Start SDL
    SDL_Init( SDL_INIT_EVERYTHING );

    //Set up screen
    screen = SDL_SetVideoMode( 640, 480, 32, SDL_SWSURFACE );

    //Load image
    hello = SDL_LoadBMP( "hello.bmp" );

    //Apply image to screen
    SDL_BlitSurface( hello, NULL, screen, NULL );

    //Update Screen
    SDL_Flip( screen );

    //Pause
    SDL_Delay( 2000 );

    //Free the loaded image
    SDL_FreeSurface( hello );

    //Quit SDL
    SDL_Quit();

    return 0;
}

 This builds without error, but does not generate a binary for me to run. Only a .o

 

Any suggestions?

 

EDIT: I am also including TCO with it. It is tripping up there. Am i missing something in my code for TCO to run properly?

 

C:\Users\Acer\Desktop\TouchControlOverlay\Device-Debug/libTouchControlOverlay.so: undefined reference to `png_create_read_struct'
C:\Users\Acer\Desktop\TouchControlOverlay\Device-Debug/libTouchControlOverlay.so: undefined reference to `xmlStrncasecmp'
C:\Users\Acer\Desktop\TouchControlOverlay\Device-Debug/libTouchControlOverlay.so: undefined reference to `xmlDocGetRootElement'
C:\Users\Acer\Desktop\TouchControlOverlay\Device-Debug/libTouchControlOverlay.so: undefined reference to `png_init_io'
C:\Users\Acer\Desktop\TouchControlOverlay\Device-Debug/libTouchControlOverlay.so: undefined reference to `png_get_image_height'
C:\Users\Acer\Desktop\TouchControlOverlay\Device-Debug/libTouchControlOverlay.so: undefined reference to `png_get_image_width'
C:\Users\Acer\Desktop\TouchControlOverlay\Device-Debug/libTouchControlOverlay.so: undefined reference to `png_create_info_struct'
C:\Users\Acer\Desktop\TouchControlOverlay\Device-Debug/libTouchControlOverlay.so: undefined reference to `png_set_tRNS_to_alpha'
C:\Users\Acer\Desktop\TouchControlOverlay\Device-Debug/libTouchControlOverlay.so: undefined reference to `png_set_longjmp_fn'
C:\Users\Acer\Desktop\TouchControlOverlay\Device-Debug/libTouchControlOverlay.so: undefined reference to `png_read_image'
C:\Users\Acer\Desktop\TouchControlOverlay\Device-Debug/libTouchControlOverlay.so: undefined reference to `png_set_palette_to_rgb'
C:\Users\Acer\Desktop\TouchControlOverlay\Device-Debug/libTouchControlOverlay.so: undefined reference to `xmlReadFile'
C:\Users\Acer\Desktop\TouchControlOverlay\Device-Debug/libTouchControlOverlay.so: undefined reference to `xmlFreeDoc'
C:\Users\Acer\Desktop\TouchControlOverlay\Device-Debug/libTouchControlOverlay.so: undefined reference to `png_read_info'
C:\Users\Acer\Desktop\TouchControlOverlay\Device-Debug/libTouchControlOverlay.so: undefined reference to `png_set_bgr'
C:\Users\Acer\Desktop\TouchControlOverlay\Device-Debug/libTouchControlOverlay.so: undefined reference to `xmlCleanupParser'
C:\Users\Acer\Desktop\TouchControlOverlay\Device-Debug/libTouchControlOverlay.so: undefined reference to `png_destroy_read_struct'

 EDIT: I was missing png and xml2

 

Contributor
Posts: 10
Registered: ‎11-14-2011
My Device: Blackberry Playbook
My Carrier: T-Mobile

Re: First SDL app on playbook, builds but does not create a binary.

As a note. This sometimes does happen to me for absolutely no good reason. Just go to project and rebuild all. That almost always fixes it. I have had it persist for some odd reason at times.

Highlighted
Retired
Posts: 25
Registered: ‎01-30-2012
My Device: Bold 9900
My Carrier: Rogers

Re: First SDL app on playbook, builds but does not create a binary.

It seems to be missing the 'png' library on the linking phase. Can you confirm you are linking against it?

 

Go to your project settings, C/C++ Build, select tab "Tool Settings". You'll see "QCC Linker, Libraries" folders on the list. You must have 'png' there.

 

Another way to check it is when you are compiling look at the last line (the linking phase, starting with "qcc -o", you should see a "-lpng" modifier.