Skip to main content



      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 11:08 Go to next message
Eclipse UserFriend
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 14992 times)
  • Attachment: Capture4.PNG
    (Size: 262.87KB, Downloaded 13331 times)
  • Attachment: Capture3.PNG
    (Size: 249.90KB, Downloaded 13217 times)
Re: Undefined Reference to ' ' error (Linux Ubuntu) [message #1751905 is a reply to message #1751830] Mon, 16 January 2017 12:31 Go to previous messageGo to next message
Eclipse UserFriend
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] Mon, 16 January 2017 23:58 Go to previous message
Eclipse UserFriend
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: Wed May 21 08:22:06 EDT 2025

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

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

Back to the top