Bulding own application which uses TI`s sgx libs with oe+bitbake

Hello

Im trying to compile file (myopengl.cpp) which is exact copy of
OMAP35x_Graphics_SDK_3_00_00_06/GFX_Linux_SDK/OGLES/SDKPackage/
TrainingCourse/01_Initialization/OGLES/OGLESInitialization_NullWS.cpp
Im using following bitbake recipe: http://paste2.org/p/416443
It crashes at do_compile step and log.do_compile.xxxxxx contains this
error:

/tmp/ccnGTEbT.o: In function `TestEGLError(char const*)':
myopengl.cpp:(.text+0x8): undefined reference to `eglGetError'
/tmp/ccnGTEbT.o: In function `main':
myopengl.cpp:(.text+0x48): undefined reference to `eglGetDisplay'
myopengl.cpp:(.text+0x58): undefined reference to `eglInitialize'
myopengl.cpp:(.text+0x94): undefined reference to `eglChooseConfig'
myopengl.cpp:(.text+0xc8): undefined reference to
`eglCreateWindowSurface'
myopengl.cpp:(.text+0xf0): undefined reference to `eglCreateContext'
myopengl.cpp:(.text+0x118): undefined reference to `eglMakeCurrent'
myopengl.cpp:(.text+0x13c): undefined reference to `glClearColor'
myopengl.cpp:(.text+0x144): undefined reference to `glClear'
myopengl.cpp:(.text+0x164): undefined reference to `eglSwapBuffers'
myopengl.cpp:(.text+0x19c): undefined reference to `glClearColor'
myopengl.cpp:(.text+0x1bc): undefined reference to `eglMakeCurrent'
myopengl.cpp:(.text+0x1c4): undefined reference to `eglTerminate'
collect2: ld returned 1 exit status

Im using Angstrom console-image, kernel 2.6.29.
I think i have all needed files in tmp/staging/armv7a-angstrom-linux-
gnueabi/usr/include and lib directories. I done the
HowtoUseSGXunderAngstrom instructions.

Or maybe there is other way to make own software?

You need to tell the linker that you are using the opengl es libraries. I
am not sure how you would do that in your .bb file unless it is as easy as
adding -lGLES_CM. I have been using cmake in my builds through OE.

David.

You need to edit your do_compile function in the bb package and add
-lGLES_CM

From: beagleboard@googlegroups.com
[mailto:beagleboard@googlegroups.com] On Behalf Of David Batzle
Sent: Monday, September 07, 2009 2:40 AM
To: beagleboard@googlegroups.com
Subject: [beagleboard] Re: Bulding own application which uses TI`s sgx
libs with oe+bitbake

> From: kelass <surikatga@gmail.com>
> Subject: [beagleboard] Bulding own application which uses TI`s sgx
libs with oe+bitbake
> To: "Beagle Board" <beagleboard@googlegroups.com>
> Date: Sunday, September 6, 2009, 3:14 PM
>
> Hello
>
> Im trying to compile file (myopengl.cpp) which is exact
> copy of
> OMAP35x_Graphics_SDK_3_00_00_06/GFX_Linux_SDK/OGLES/SDKPackage/
>

TrainingCourse/01_Initialization/OGLES/OGLESInitialization_NullWS.cpp

> Im using following bitbake recipe: http://paste2.org/p/416443
> It crashes at do_compile step and log.do_compile.xxxxxx
> contains this
> error:
>
> /tmp/ccnGTEbT.o: In function `TestEGLError(char const*)':
> myopengl.cpp:(.text+0x8): undefined reference to
> `eglGetError'
> /tmp/ccnGTEbT.o: In function `main':
> myopengl.cpp:(.text+0x48): undefined reference to
> `eglGetDisplay'
> myopengl.cpp:(.text+0x58): undefined reference to
> `eglInitialize'
> myopengl.cpp:(.text+0x94): undefined reference to
> `eglChooseConfig'
> myopengl.cpp:(.text+0xc8): undefined reference to
> `eglCreateWindowSurface'
> myopengl.cpp:(.text+0xf0): undefined reference to
> `eglCreateContext'
> myopengl.cpp:(.text+0x118): undefined reference to
> `eglMakeCurrent'
> myopengl.cpp:(.text+0x13c): undefined reference to
> `glClearColor'
> myopengl.cpp:(.text+0x144): undefined reference to
> `glClear'
> myopengl.cpp:(.text+0x164): undefined reference to
> `eglSwapBuffers'
> myopengl.cpp:(.text+0x19c): undefined reference to
> `glClearColor'
> myopengl.cpp:(.text+0x1bc): undefined reference to
> `eglMakeCurrent'
> myopengl.cpp:(.text+0x1c4): undefined reference to
> `eglTerminate'
> collect2: ld returned 1 exit status
>
> Im using Angstrom console-image, kernel 2.6.29.
> I think i have all needed files in
> tmp/staging/armv7a-angstrom-linux-
> gnueabi/usr/include and lib directories. I done the
> HowtoUseSGXunderAngstrom instructions.
>
> Or maybe there is other way to make own software?
>

You need to tell the linker that you are using the opengl es

libraries.

I
am not sure how you would do that in your .bb file unless it is as

easy

I changed my recipe, and do_compile function looks now:

do_compile() {
        ${CXX} ${CXXFLAGS} ${LDFLAGS} -lGLES_CM ${WORKDIR}/
myopengl.cpp -o myopengl
}

Im able to compile a OGLESInitialization_NullWS.cpp. When i tried to
run it on arm, app printed error about missing libstdc++.so.6 but i
get this files from latest Angstrom-Beagleboard-demo image from
www.angstrom-distribution.org . For now its work pretty well, thanks
for help.