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
Zymatic
Posts: 144
Registered: ‎12-18-2010
My Device: Limited Edition Z10 & Blackberry Playbook

Undefined Referece to 'function_name' error.

[ Edited ]

Hi All,

 

I'm currently working on a C++ project, creating a sort of Application framework similar to the BBUtils.c and .h files that sets up the screen contexts and initializes EGL, etc... , but does so in a class.  While writing the code the IDE had no issues finding the functions that I was using from the various headers in the NDK.  But once I tried to build the project so I could deploy it to the device, I started gettting " Undefined reference to 'function_name_here' " errors.  The errors are showing for every EGL function that I am calling as well as the screen_ functions I am using.  I am including the egl.h as well as screen.h where I should be.  If I highlight one of the functions in question and press F3 ( Open Declaration )  it opens the header file and finds the function. 

 

When I created the project I chose C++ as my Language and "Empty Application Project" as my Project Type in the New Project dialog.

 

If I start a new C language project there are no issues, so I am thinking that maybe there is a bug in the project creation of a C++ language project?

 

EDIT:  Another thing I wanted to add was that none of the structs that are in the screen.h or egl.h that I am using in my class, for example: screen_context_t, are causing any compiler errors.  Only the functions.

 

Any help would be greatly appreciated.

Playbook Apps:
Touch Painter, LinkShrink

BB10 Apps:
NoteToSelf , LinkShrink
Developer
Zymatic
Posts: 144
Registered: ‎12-18-2010
My Device: Limited Edition Z10 & Blackberry Playbook

Re: Undefined Referece to 'function_name' error.

I believe I have solved my problem.  It seemed that all the compiler and linker settings had been erased.  None of the include directories were set or any of the libraries linked.

Playbook Apps:
Touch Painter, LinkShrink

BB10 Apps:
NoteToSelf , LinkShrink
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: Undefined Referece to 'function_name' error.

Earsed in just your new project or all existing projects?
Developer
Zymatic
Posts: 144
Registered: ‎12-18-2010
My Device: Limited Edition Z10 & Blackberry Playbook

Re: Undefined Referece to 'function_name' error.

Just the new project.  I was looking through the settings and noticed the Compiler/Linker settings were gone, so I used one of my other projects to get the right values and replace them. 

 

I don't have an answer as to why this happened.  If I create a new project the settings are all there.

Playbook Apps:
Touch Painter, LinkShrink

BB10 Apps:
NoteToSelf , LinkShrink
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: Undefined Referece to 'function_name' error.

Odd. If you can reproduce the steps, I would submit it as a bug for RIM to take a look at.
BlackBerry Development Advisor
elena_laskavaia
Posts: 417
Registered: ‎10-27-2010
My Device: PlayBook

Re: Undefined Referece to 'function_name' error.

egl headers do they declare c linkage for these functions? Because this could be the problem