Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Undefined Reference to ' ' error (Linux Ubuntu)
Undefined Reference to ' ' error (Linux Ubuntu) [message #1751830] Sun, 15 January 2017 16:08 Go to next message
Gabriel Lee is currently offline Gabriel LeeFriend
Messages: 3
Registered: January 2017
Junior Member
Hello,

I am trying to compile a code related to pocketsphinx. I am using ubuntu 14.04. But when i tried to build the code, it gives me error saying "undefined reference to 'cmd_ln_free ' " for example . This cmd-ln-free is a function located in one of the header file used. All the header files are located in a folder in home directory. I read from other forums that this may be a problem related to the linking of folders section, but i have already included a path to the folder with all the headers in the Cross GCC and Cross G++ compiler "includes path" section. I have also linked the folder in the C/C++ General --> path and symbols. The snapshots below show the error and also some of my settings. Any suggestions is most appreciated.

index.php/fa/28130/0/

index.php/fa/28131/0/

index.php/fa/28132/0/
  • Attachment: Capture2.PNG
    (Size: 215.19KB, Downloaded 11622 times)
  • Attachment: Capture4.PNG
    (Size: 262.87KB, Downloaded 11299 times)
  • Attachment: Capture3.PNG
    (Size: 249.90KB, Downloaded 11409 times)
Re: Undefined Reference to ' ' error (Linux Ubuntu) [message #1751905 is a reply to message #1751830] Mon, 16 January 2017 17:31 Go to previous messageGo to next message
Jonah Graham is currently offline Jonah GrahamFriend
Messages: 404
Registered: June 2014
Senior Member
The problem here is you have compiled fine, but you have not linked fine. Compiling requires the libraries header files, but linking requires their implementation.

You have correctly added to C/C++ Build -> Settings -> Cross GCC Compiler -> Includes -> Include Paths.

Now you need to do similar for C/C++ Build -> Settings -> Cross G++ Linker -> Libraries

The exact value that goes in library paths and library itself will be the location and name (without lib prefix or .a suffix) of the libNAME.a.
Re: Undefined Reference to ' ' error (Linux Ubuntu) [message #1751947 is a reply to message #1751905] Tue, 17 January 2017 04:58 Go to previous message
Gabriel Lee is currently offline Gabriel LeeFriend
Messages: 3
Registered: January 2017
Junior Member
Thanks a lot Jonah. I am able to build it properly now.
Previous Topic:Artefacts in Eclipse Neon.2 code editor
Next Topic:old project (Ganymede) open with eclipse Neon
Goto Forum:
  


Current Time: Tue Jan 25 21:07:45 GMT 2022

Powered by FUDForum. Page generated in 0.01886 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top