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 7957605
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:16:30+00:00 2026-06-04T04:16:30+00:00

I am creating a word list searcher in C for my program using sqlite3

  • 0

I am creating a word list searcher in C for my program using sqlite3 but I’ve got these errors .
I tried whatever I knew but it didn’t fixed. I guess the problem is in my join function but I am not sure.

code :

bool *gb_wordlist_add_to_list (gbwordlist *word_list,char *str)
{
int sql_error;
char *error_massage;
if (gb_wordlist_in_list (word_list,str))
    {
    sql_error = sqlite3_execute(word_list->database, gb_wordlist_join(ADD_TO_TABLE_COMMAND"\'",str,"\';"),
                                NULL ,NULL, &error_massage);    
    if( sql_error!=SQLITE_OK )
    {
        fprintf(stderr, "SQL error: %s\n", error_massage);
        sqlite3_free(error_massage);
        return 0;
    }

    }
else
    return 0;

}


char *gb_wordlist_join (char *s1,char *s2,char *s3){
char *s;
s = malloc(strlen(s1) + strlen(s2) + strlen(s3) + 1);
if(s)
{
    strcpy(s,s1);
    strcat(s,s2);
    strcat(s,s3);
}
return s;
}

error:

gb-sql.o: In function `gb_wordlist_remove_from_list':
/home/reza/Project/GB/Search algorithm/Source/gb-search/src/gb-sql.c:104: undefined reference to `sqlite3_execute'

Also my full codes are here. Thanks a lot!

  • 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-06-04T04:16:31+00:00Added an answer on June 4, 2026 at 4:16 am

    The reason you are getting undefined reference to sqlite3_execute is well there is no such function as part of library. You probably meant to use sqlite3_exec (which use have used in some parts of the code).
    Side Notes:

    1. The function gb_wordlist_callback is returning int but has been declared to return int*. You should change the return type to int to match the expected parameters to be passed to sqlite3_exec(after modifying from sqlite3_execute)
    2. The 4th parameter passed to sqlite3_exec (after modifying from sqlite3_execute) is expected to be void* so existance should be &existance
    3. You have quite a few functions with mismatch between return type declared and the actual return type returned from the function.
    4. Compile your code with -Wall -Wextra compiler options & fix all the warnings. It is good practice.

    Hope this helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using .NET and the Word Interop I am programmatically creating a new Word doc
I am currently in the process of creating API documentation using Microsoft Word 2007
I'm using a list element with variableRowHeight and word-wrap set to true like in
I'm creating a word document programatically using VBA. 1) I have a a string
I am creating a word game. I have a list of all the words
I'm creating list dynamically in javascript. I want to break the long word in
I am currently creating an IDE using Scintilla for the Text component. But autocomplete
I'm running into the classic scenario where, when creating Word COM objects in .NET
I am creating a Word class and I am getting an error: TypeError: superclass
Creating a simple RPG game, first time using XNA. Trying to get my character

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.