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
New Developer
ahsan_iqbal
Posts: 26
Registered: ‎04-11-2012
My Carrier: BlackBerry
Accepted Solution

Having trouble with undefined reference to error

I know there are a lot of posts related to this particular error but nothing seems to be helpful in ,my case, So please forgive me for that I am posting question after almost 2 days of research on google:smileysad:

I am working on a game for blackberry playbook, and for sound/audio I am using openal along with OggVorbis, I have downloaded blackberry port of OggVorbis from following source

https://github.com/blackberry/OggVorbis

but its integration with game is creating issue like it says undefined reference to ov_clear that is in vorbisfile.h and vorbisfile.c is compiled and I can see ov_clear in libvorbis.a qnx momentics IDE, and I have added libvorbis in my game but still I am getting these errors

Please help

Please use plain text.
BlackBerry Development Advisor (Retired)
mgoulet
Posts: 329
Registered: ‎05-07-2012
My Carrier: N/A

Re: Having trouble with undefined reference to error

Hey there,

 

I have never experimented with OggVorbis myself, but sounds like your IDE is not finding your vorbisfile.h;

I understand that your lib is compiled, but are you including the header in your source file where it is referenced?

 

Martin

 

Please use plain text.
Developer
BGmot
Posts: 1,064
Registered: ‎11-24-2011
My Carrier: x

Re: Having trouble with undefined reference to error

Please post exact error text.

Please use plain text.
Developer
step_jac
Posts: 89
Registered: ‎05-31-2012
My Carrier: Bell

Re: Having trouble with undefined reference to error

Hi there,

 

We've compiled ogg/vorbis from standard distro without any problems. From the looks of your error, it sounds like you may not be linking libogg. Ensure that you link both libvorbis and libogg. If you are already linking both, also ensure that the link order is correct. You need to link vorbis before Ogg to satisfy link dependency.

 

Best,

 

Stephane

Please use plain text.
BlackBerry Development Advisor (Retired)
rmadhavan
Posts: 29
Registered: ‎03-19-2012
My Carrier: BELL

Re: Having trouble with undefined reference to error

[ Edited ]

Just an FYI - posted an blog post on using OpenAL + OggVorbis on BlackBerry Native SDK.

 

http://devblog.blackberry.com/2012/08/hello-oggvorbis/

 

cheers, Ram

Please use plain text.
Developer
cycletronic
Posts: 113
Registered: ‎03-23-2011
My Carrier: Platinumtel

Re: Having trouble with undefined reference to error

I am also having trouble using libvorbis as it is built with the OggVorbis github source.  Lots of "undefined reference" errors, but I am positive that I am linking the libvorbis.a file correctly.  I think it stems from lacking libogg, as mentioned a couple posts above, but information about using the library is conflicting.  

 

From here: http://devblog.blackberry.com/2012/08/hello-oggvorbis/ it seems we should not need to build libogg separately.  The github readme at some point says we do need to link to libogg separately.  Somewhere else (I forgot where) it says that the libvorbis built by the github OggVorbis source includes both the ogg and vorbis components in the libvorbis library.

 

My solution was to simply use the libvorbis.a that comes built with the cocos2d-x source for the CocosDenshion sub-project, and it works.

----------------
WIP game: Melodaeum
My graphically bland but very useful Morse Code trainer: Speed CW
My graphically attractive but boring game: The Rainstorm
Please use plain text.