Need example code for C and Sqlite

Started by valema, January 24, 2023, 12:00:54 AM

Previous topic - Next topic

valema

Hello, yes that's it; and with or without ODBC.
I have tried using the raw sqlite.c (and .h) code but got these errors:

POLINK: error: Unresolved external symbol '__endthreadex' - referenced from 'C:\SQLite\sqlite-amalgamation-3400100\output\sqlite3.obj'.
POLINK: error: Unresolved external symbol '__beginthreadex' - referenced from 'C:\SQLite\sqlite-amalgamation-3400100\output\sqlite3.obj'.

(I run windows 10, 64)

I then installed odbc for sqlite... and

http://www.intelmenu.com/notes/c/c_odbc.html

copy pasted that code (a new project): got other errors,

POLINK: error: Unresolved external symbol '_SQLAllocHandle@12' - referenced from 'C:\Users\valte\Documents\videoprojekt\app_med_go_java_sqlite\c\test_odbc\output\prog.obj'.
POLINK: error: Unresolved external symbol '_SQLSetEnvAttr@16' - referenced from 'C:\Users\valte\Documents\videoprojekt\app_med_go_java_sqlite\c\test_odbc\output\prog.obj'.
POLINK: error: Unresolved external symbol '_SQLSetConnectAttr@16' - referenced from 'C:\Users\valte\Documents\videoprojekt\app_med_go_java_sqlite\c\test_odbc\output\prog.obj'.
POLINK: error: Unresolved external symbol '_SQLConnect@28' - referenced from 'C:\Users\valte\Documents\videoprojekt\app_med_go_java_sqlite\c\test_odbc\output\prog.obj'.
POLINK: error: Unresolved external symbol '_SQLDisconnect@4' - referenced from 'C:\Users\valte\Documents\videoprojekt\app_med_go_java_sqlite\c\test_odbc\output\prog.obj'.
POLINK: error: Unresolved external symbol '_SQLFreeHandle@8' - referenced from 'C:\Users\valte\Documents\videoprojekt\app_med_go_java_sqlite\c\test_odbc\output\prog.obj'.
POLINK: error: Unresolved external symbol '_SQLExecDirect@12' - referenced from 'C:\Users\valte\Documents\videoprojekt\app_med_go_java_sqlite\c\test_odbc\output\prog.obj'.
POLINK: error: Unresolved external symbol '_SQLFetch@4' - referenced from 'C:\Users\valte\Documents\videoprojekt\app_med_go_java_sqlite\c\test_odbc\output\prog.obj'.
POLINK: error: Unresolved external symbol '_SQLGetData@24' - referenced from 'C:\Users\valte\Documents\videoprojekt\app_med_go_java_sqlite\c\test_odbc\output\prog.obj'.

TimoVJL

#1
Quote from: valema on January 24, 2023, 12:00:54 AM
Hello, yes that's it; and with or without ODBC.
I have tried using the raw sqlite.c (and .h) code but got these errors:

POLINK: error: Unresolved external symbol '__endthreadex' - referenced from 'C:\SQLite\sqlite-amalgamation-3400100\output\sqlite3.obj'.
POLINK: error: Unresolved external symbol '__beginthreadex' - referenced from 'C:\SQLite\sqlite-amalgamation-3400100\output\sqlite3.obj'.
Choose from project options Compiler -> Code generation multithreaded library

SQLite use __cdecl , so use it project too.

this project might have modified header file sqlite3c.h for __cdecl
https://forum.pellesc.de/index.php?topic=3110.msg14062#msg14062

For ODBC
add odbc32.lib to project

https://forum.pellesc.de/index.php?topic=2489.msg9424#msg9424

May the source be with you

John Z

#2
Quote from: valema on January 24, 2023, 12:00:54 AM
Hello, yes that's it; and with or without ODBC.

Need sample code
In this forum look for CFE, if not found it is also hosted at
https://sourceforge.net/projects/convolution-filter-editor/
a good example using sqllite and Pelles C by forum member Grincheux

John Z

forum
https://forum.pellesc.de/index.php?topic=10182.msg35965#msg35965 

another sqlite program example link with smaller overhead
https://forum.pellesc.de/index.php?topic=10177.0