I have seen this error before but never thought much about it.
filename.obj : error link2001: unresolved external symbol _sqlite3_open
filename.exe : fatal error link1120 : 1 unresolved externals
I checked in the net but no very convincing explanation.
So what does it mean ?
0 warning 0 errors !! ... no success
Some place in the net to enlighten me ?
You are either missing an include file or missing a library. Find out where _sqlite3_open comes from and get the required file then include it.
http://www.sqlite.org/download.html (http://www.sqlite.org/download.html)
After use PoLib to create to import library from the ".def"
Vortex also has utilities that could help you.
Hutch, Jokaste,
thank you, but that was not my problem. The sqlite problem I ""resolved"" 1 minute later .
I was/am after some material (book, pdf, site) which explains what really is happening there. (like I said ...which could "enlighten" me.
A message "0 warnings 0 errors" and no result is hard to digest, because certainly something is very wrong.
If I remember well the sqlite dll was cdecl not stdcall.
Quote from: clamicun on December 16, 2017, 10:58:07 AMA message "0 warnings 0 errors" and no result is hard to digest, because certainly something is very wrong.
You build a project in two phases
- assemble
- link
The assembler sees a
MyStuff proc in your code, and later on a
call MyStuff. No problem.
But then there is an
invoke GetTickCount but no
GetTickCount proc ::)
So the assembler says "I don't know GetTickCount,
error!"
Therefore we use an include file that contains
GetTickCount PROTO to tell the assembler "don't worry, the linker will provide you with the address of that proc that you won't see in your code".
So with the PROTO, you get "0 warnings 0 errors" for the assembly phase, and afterwards the linker links everything together.
Except if it can't find GetTickCount, of course - then it complains "you cheated, there is no GetTickCount: unresolved external symbol".
jj thank you,
with this sqlite project I went the easier way. Using "Fresh IDE project - FreshLib reference - Flat Assembler" ... It comes with a sqlite3.inc file
which contains all protos you need.
There is an example in the net (https://stackoverflow.com/questions/11939956/how-can-i-use-sqlite3-with-masm32-on-windows) which looks ok. but produces exactely the "unresolved external error" .Do not know how this guy assembled it successfully.
I compiled a static version of SQLite for assembler and uploaded it to my github libraries repository: https://github.com/mrfearless/libraries/tree/master/SQLite (https://github.com/mrfearless/libraries/tree/master/SQLite)
There is also a demo test RadASM project SQLiteTest by Mark Jones that i used to test the static libraries against and to verify it compiled and worked ok.
https://github.com/mrfearless/libraries/blob/master/releases/SQLite_x86.zip?raw=true (https://github.com/mrfearless/libraries/blob/master/releases/SQLite_x86.zip?raw=true)
https://github.com/mrfearless/libraries/blob/master/releases/SQLiteTest.zip?raw=true (https://github.com/mrfearless/libraries/blob/master/releases/SQLiteTest.zip?raw=true)
There is also an x64 version, but havent got round to testing that or verifying that the static x64 library is working.
Fearless, thanks ... Interesting, I check this out ...
Fearless,
your "SQLiteTest.asm from Github does it.
But not easyly.
First time it gave me:
0 warnings 0 errors and this...
warning LNK4044: unreecognized option "alternatename:__isa_available=__usa_available_default"; ignored
LINK fatal error LNK:1104: can not open file "uuid.lib"
I found an uuid.lib on my computer somewhere and put it into the SQLiteTest folder.
It worked. ??