Thread: Help me Debug this Compile Error...

  1. #1
    Registered User
    Join Date
    Jul 2012
    Posts
    2

    Help me Debug this Compile Error...

    ERROR:
    Code:
    src/core.o: In function `core_load_file':
    core.c:(.text+0xb1): undefined reference to `fgetln'
    src/func.o: In function `func_call':
    func.c:(.text+0x2b9): undefined reference to `ffi_type_pointer'
    func.c:(.text+0x2e2): undefined reference to `ffi_type_pointer'
    func.c:(.text+0x357): undefined reference to `ffi_type_pointer'
    func.c:(.text+0x364): undefined reference to `ffi_prep_cif'
    func.c:(.text+0x3b6): undefined reference to `ffi_call'
    collect2: ld returned 1 exit status
    make: *** [testrunner] Error 1
    You can grab the code I'm trying build directly from here:
    https://github.com/DanSchmidt/anti-lisp

    I'm running
    Code:
    make test
    I'm on a Ubuntu 12.04 box, I've installed all the available libbsd packages available from universe.

    I'm just sorta stumped at the moment, total C noob, wondering if someone could lend a hand.

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    This is a link error:
    core.c.text+0xb1): undefined reference to `fgetln'
    It seems that fgetln is included in <stdio.h> for various flavours of BSD, and since you claim that you "installed all the available libbsd packages available from universe", I am inclined to think that you may need to check if you need to do something besides just installing, e.g., pass an option to the compiler.

    For the other link errors: search the source code for where those functions are defined, then check why they were not being linked. If those functions are not defined anywhere, then you may be missing some library to install.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User
    Join Date
    Jul 2012
    Posts
    2
    Quote Originally Posted by laserlight View Post
    This is a link error:

    It seems that fgetln is included in <stdio.h> for various flavours of BSD, and since you claim that you "installed all the available libbsd packages available from universe", I am inclined to think that you may need to check if you need to do something besides just installing, e.g., pass an option to the compiler.
    Ah, I see. I'm guessing I have to pass in the -lbsd flag somewhere. I had been attempting to just add include statements to the files above, but perhaps the exclusion of the of flag pointing to my libbsd libs is why the fgetln error persists.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 15
    Last Post: 11-28-2011, 11:48 AM
  2. Replies: 6
    Last Post: 05-28-2008, 02:54 AM
  3. Visual Studio 2005 - Debug code with compile errors?
    By Swerve in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 03-17-2008, 08:12 AM
  4. Debug/Compile C in VISUAL STUDIO --need help!
    By bcgabriot in forum C Programming
    Replies: 4
    Last Post: 05-21-2007, 02:49 AM
  5. Replies: 4
    Last Post: 09-16-2006, 07:11 PM