Find the answer to your Linux question:
Results 1 to 4 of 4
I'm new to both Ubuntu and C compilation. I want to compile a version of dosfsck.. I download the latest source as tar.gz and executed: Code: #:~/Downloads/comp/dosfstools-3.0.9/src$ gcc -o kkkk ...
  1. #1
    Just Joined!
    Join Date
    Sep 2011
    Posts
    2

    Question Compiling dosfsck under Natty Narwhal

    I'm new to both Ubuntu and C compilation. I want to compile a version of dosfsck..

    I download the latest source as tar.gz and executed:

    Code:
    #:~/Downloads/comp/dosfstools-3.0.9/src$ gcc -o kkkk dosfsck.c
    I get the following output:

    Code:
    dosfsck.c:(.text+0x34a): undefined reference to `file_add'
    dosfsck.c:(.text+0x3bb): undefined reference to `file_add'
    dosfsck.c:(.text+0x4ba): undefined reference to `fs_open'
    dosfsck.c:(.text+0x4c6): undefined reference to `read_boot'
    dosfsck.c:(.text+0x4ea): undefined reference to `qfree'
    dosfsck.c:(.text+0x4f9): undefined reference to `read_fat'
    dosfsck.c:(.text+0x505): undefined reference to `scan_root'
    dosfsck.c:(.text+0x51e): undefined reference to `fix_bad'
    dosfsck.c:(.text+0x534): undefined reference to `reclaim_file'
    dosfsck.c:(.text+0x542): undefined reference to `reclaim_free'
    dosfsck.c:(.text+0x54e): undefined reference to `update_free'
    dosfsck.c:(.text+0x557): undefined reference to `file_unused'
    dosfsck.c:(.text+0x563): undefined reference to `qfree'
    dosfsck.c:(.text+0x59b): undefined reference to `read_fat'
    dosfsck.c:(.text+0x5a7): undefined reference to `scan_root'
    dosfsck.c:(.text+0x5b3): undefined reference to `reclaim_free'
    dosfsck.c:(.text+0x5bf): undefined reference to `qfree'
    dosfsck.c:(.text+0x5d0): undefined reference to `fs_changed'
    dosfsck.c:(.text+0x5fa): undefined reference to `get_key'
    dosfsck.c:(.text+0x66e): undefined reference to `fs_close'
    To be honest, the docu does say: dosfsck needs header files from dosfs.9 (or later) to compile

    Being new at this, I cant seem to find how to get these header files. I tried to find source code for dosfs, in an effort to copy these .h files to y src dir, but didnt get them either. Would be glad if someone can guide me..

  2. #2
    Linux Guru
    Join Date
    May 2011
    Posts
    1,855
    Is there any reason why you don't just run make in the parent directory? I got the same error you did when I tried the same command on that source tarball, but running make, while b!tching alot, did compile dosfsck successfully for me.

  3. #3
    Just Joined!
    Join Date
    Sep 2011
    Posts
    2
    Quote Originally Posted by atreyu View Post
    Is there any reason why you don't just run make in the parent directory? I got the same error you did when I tried the same command on that source tarball, but running make, while b!tching alot, did compile dosfsck successfully for me.
    Thanks! I discovered this only 10 mins ago..
    I'm actally using Ubuntu to build a binary for Android using the Android NDK toolchain..Make definitely gave me a binary, now have to find out to cross compile and add libraries statically to the binary so that it works on the phone,,

  4. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,977
    Why compile it? You should have a version on your system in /sbin if you have the dosfstools package installed.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...