NO

Author Topic: Access violation error using sqlite3 functions  (Read 12806 times)

David L Morris

  • Guest
Re: Access violation error using sqlite3 functions
« Reply #15 on: October 05, 2009, 11:29:45 AM »
Hello to you I am a new user.  I downloaded the wrsqlit3 project files and was pleased to find the included exe file ran and worked as might be expected.  When I tried to compile it with my new Pelles C version 6.00.4, the compile does not work and displays the following:-

Building main.obj.
Building main.res.
Building wrsqlit3.exe.
POLINK: error: Unresolved external symbol '_sqlite3_open@8'.
POLINK: error: Unresolved external symbol '_sqlite3_close@4'.
POLINK: error: Unresolved external symbol '_sqlite3_malloc@4'.
POLINK: error: Unresolved external symbol '_sqlite3_exec@20'.
POLINK: error: Unresolved external symbol '_sqlite3_free@4'.
POLINK: error: Unresolved external symbol '_sqlite3_errcode@4'.
POLINK: error: Unresolved external symbol '_sqlite3_errmsg@4'.
POLINK: fatal error: 7 unresolved external(s).
*** Error code: 1 ***
Done.

In hope you might be able to help?  I have been using PowerBasic to successfully work on SQLite3. Now I am retired I want to relearn the  C language.

Thanks  David

Offline Stefan Pendl

  • Global Moderator
  • Member
  • *****
  • Posts: 582
    • Homepage
Re: Access violation error using sqlite3 functions
« Reply #16 on: October 05, 2009, 12:14:24 PM »
There are several threads dealing with this problem, so please try searching for "sqlite" to get the resolution.
---
Stefan

Proud member of the UltraDefrag Development Team

David L Morris

  • Guest
Re: Access violation error using sqlite3 functions
« Reply #17 on: October 05, 2009, 01:33:11 PM »
Ok Stefan, my search for sqlite seems to only present this complete thread. I made changes to the Sqlite3.h file and it still doesn't compile but the errors showing are as below so I would appreciate any more guidance.

Building wrsqlit3.exe.
POLINK: error: Unresolved external symbol '_sqlite3_malloc@4'.
POLINK: error: Unresolved external symbol '_sqlite3_free@4'.
POLINK: error: Unresolved external symbol '_sqlite3_errmsg@4'.
POLINK: fatal error: 3 unresolved external(s).
*** Error code: 1 ***
Done.

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2113
Re: Access violation error using sqlite3 functions
« Reply #18 on: October 05, 2009, 08:34:57 PM »
The error you get clearly declare that the missing functions are expected to be __stdcall (as highlited from the presence of decorations), but the sqlite3 libraries and DLL are __cdecl.
This means that you haven't modified correctly the sqlite3.h adding __cdecl attribute at each function declaration as explained in many threads on this issue (as Stefan said).
Please make the required corrections and also read better the threads so you will find also the sqlite3.h file correctly updated.
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

David L Morris

  • Guest
Re: Access violation error using sqlite3 functions
« Reply #19 on: October 05, 2009, 10:56:12 PM »
Thanks frankie. I have just corrected what I think are the last changes and it compiles OK.  I added a word to the dialog caption and that shows up correctly in the compiled exe.  Now I can try some actual development, so no doubt I will be back for help as time proceeds.
Regards
David

David L Morris

  • Guest
Re: Access violation error using sqlite3 functions
« Reply #20 on: October 06, 2009, 12:09:57 AM »
I see that for each project in pelles C, an Sqlite3 database file (*.tag) is created with a browse table in the project folder.  That is interesting to me and gives an endorsement to the quality of the Sqlite database. I would appreciate any comment on this?

David

Offline Robert

  • Member
  • *
  • Posts: 247
Re: Access violation error using sqlite3 functions
« Reply #21 on: October 06, 2009, 06:43:46 AM »
I see that for each project in pelles C, an Sqlite3 database file (*.tag) is created with a browse table in the project folder.  That is interesting to me and gives an endorsement to the quality of the Sqlite database. I would appreciate any comment on this?

David

The quality is obvious from the implicit endorsement by many famous users. For details please see

http://www.sqlite.org/famous.html

Robert Wishlaw