Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 943229
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T22:24:10+00:00 2026-05-15T22:24:10+00:00

I am trying to run the C files downloaded from here as follows :

  • 0

I am trying to run the C files downloaded from here as follows :

gcc main.c docs_file.txt ksg_file.txt

However, I receive the following error:

/usr/bin/ld:docs_file.txt: file format not recognized; treating as linker script
/usr/bin/ld:docs_file.txt:2: syntax error
collect2: ld returned 1 exit status

I am not sure what the problem is.

Update 1:

I get the following errors while compiling:

gcc main.c -o ksg


/tmp/cc4H83rG.o: In function `main':
main.c:(.text+0xa5): undefined reference to `stree_new_tree'
main.c:(.text+0xe0): undefined reference to `stree_add_string'
main.c:(.text+0x2a7): undefined reference to `stree_match'
main.c:(.text+0x38f): undefined reference to `int_stree_set_idents'
main.c:(.text+0x422): undefined reference to `int_stree_get_parent'
main.c:(.text+0x47b): undefined reference to `int_stree_get_suffix_link'
/tmp/cc4H83rG.o: In function `count_freq':
main.c:(.text+0x96d): undefined reference to `int_stree_set_idents'
main.c:(.text+0x9a8): undefined reference to `stree_get_num_leaves'
main.c:(.text+0xa91): undefined reference to `int_stree_set_idents'
/tmp/cc4H83rG.o: In function `select_feature':
main.c:(.text+0xb34): undefined reference to `int_stree_set_idents'
main.c:(.text+0xbe7): undefined reference to `stree_get_num_children'
main.c:(.text+0xc47): undefined reference to `int_stree_get_parent'
main.c:(.text+0xc67): undefined reference to `int_stree_set_idents'
main.c:(.text+0xc94): undefined reference to `int_stree_get_parent'
main.c:(.text+0xdbb): undefined reference to `int_stree_get_suffix_link'
main.c:(.text+0xddb): undefined reference to `int_stree_set_idents'
main.c:(.text+0xe08): undefined reference to `int_stree_get_suffix_link'
collect2: ld returned 1 exit status
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T22:24:11+00:00Added an answer on May 15, 2026 at 10:24 pm

    The tarball you linked to contains source code. To run the code you need to compile it into an executable. You can then run the executable if the compilation succeeds.

    Here are the files you should have to start with, directly from the tar file:

    $ ls
    ksg     main.c      sample_ksgs.txt stree.h
    ksg.exe sample_docs.txt stree.c     stree.txt
    

    Compile

    First we’ll compile the program. The -o ksg names the executable ksg. When gcc displays nothing that means it succeeded without any errors or warnings.

    $ gcc -o ksg main.c stree.c
    

    Run

    Now we can run the ksg executable we just created. The command-line syntax is ./ksg <arguments>. For example, we can ask for help with ./ksg -?:

    $ ./ksg -?
    Dell Zhang, Wee Sun Lee.
    Extracting Key-Substring-Group Features for Text Classification.
    In Proceedings of the 12th ACM SIGKDD International Conference on
       Knowledge Discovery and Data Mining (KDD),
    Philadelphia, PA, Aug 2006.
    
    Usage: ksg [options] docs_file ksgs_file
    
    Options:
             -?          -> help
             -s [0,1]    -> assume white-spaces are word delimiters
                            (default 1)
             -l [2..]    -> the minimum frequency
                            (default 2)
             -h [l..]    -> the maximum frequency
                            (default 8,000)
             -b [2..]    -> the minimum number of branches
                            (default 2)
             -p (0..1]   -> the maximum parent-child conditional probability
                            (default 1.0)
             -q (0..1]   -> the maximum suffix-link conditional probability
                            (default 1.0)
    Arguments:
             docs_file    -> the input  file with each line as a raw document
             ksgs_file    -> the output file with each line as a bag of ksg features
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to run a .exe file (that uses some other .dll files) with
I am trying to run indent -kr -i8 on all files in my current
What I am trying to do is run the sed on multiple files in
I'm trying to get Django's manage.py to run with modified settings files. I have
I'm trying to rename some files, but getting a baffling error*. When I run
I am trying to run a batch file automatically during a build from a
Downloaded Facebook C# SDK 5.4.1 from here . I've been through the CS-WinForms solution
I'm currently trying to populate an UITableView from a plist downloaded from the internet.
I downloaded the latest video capture samples from WWDC 2010 and am trying to
I'm trying to compile and run the task-android-sample code from Google's API website. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.