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.
法典:
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 错误: %s
", 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;
}
错误:
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
我的全文是here。 感谢很多!