Re: [sqlite] First Program using sqlite3.dll - Linker Errors
Thanks very much, it worked! -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Paul Perry Sent: 28 March 2009 18:25 To: General Discussion of SQLite Database Subject: Re: [sqlite] First Program using sqlite3.dll - Linker Errors Add the lib file you generated with lib.exe into your project. Just pointing to the directory is not enough. That should fix up your link errors. On Sat, Mar 28, 2009 at 10:53 AM, Neil Jeffery wrote: > > Hi All, > > > > I am attempting to write a program which will use the sqlite3.dll file. I > am developing in Visual Studio 2008 Express on Windows Vista. > > > > I downloaded this file: http://www.sqlite.org/sqlitedll-3_6_11.zip which > contains the dll and a definitions file. I have then used lib.exe to > generate a.lib file. The lib file is currently in C:\SQLITE\. > > > > I have done the following to alter the Linker configuration in the project: > > > > 1)Right Click Project -> Properties > > 2)Configuration Properties -> Linker > > 3)I entered "C:\SQLITE\" in the "Additional Library Directories" property > field > > > > I believe that I need a sqlite3 header file in order to use the functions > in my code. This is not included in the file I downloaded above. I have > thus downloaded http://www.sqlite.org/sqlite-amalgamation-3_6_11.zip and > taken sqlite3.h from this and added it to my project. > > > > I have only one source file in the project at present which is as > http://www.sqlite.org/quickstart.html. Trying to build throws up compile > errors about the exit keyword, so I have added #include as well. > > > > Now the project compiles without warnings or errors, but I see the > following Linker Errors: > > > > 1>MAIN.obj : error LNK2019: unresolved external symbol _sqlite3_free > referenced in function _main > > 1>MAIN.obj : error LNK2019: unresolved external symbol _sqlite3_exec > referenced in function _main > > 1>MAIN.obj : error LNK2019: unresolved external symbol _sqlite3_close > referenced in function _main > > 1>MAIN.obj : error LNK2019: unresolved external symbol _sqlite3_errmsg > referenced in function _main > > 1>MAIN.obj : error LNK2019: unresolved external symbol _sqlite3_open > referenced in function _main > > 1>*PATH*\Projects\Testing\SQLITE1\Debug\SQLITE1.exe > : fatal error LNK1120: 5 unresolved externals > > > > I have never worked with DLLs before so I could be something quite > fundamental wrong. > > > > Any help or thoughts would be welcome. > > > > Many thanks, > > > > Neil > > _ > View your Twitter and Flickr updates from one place - Learn more! > http://clk.atdmt.com/UKM/go/137984870/direct/01/ > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] First Program using sqlite3.dll - Linker Errors
Add the lib file you generated with lib.exe into your project. Just pointing to the directory is not enough. That should fix up your link errors. On Sat, Mar 28, 2009 at 10:53 AM, Neil Jeffery wrote: > > Hi All, > > > > I am attempting to write a program which will use the sqlite3.dll file. I > am developing in Visual Studio 2008 Express on Windows Vista. > > > > I downloaded this file: http://www.sqlite.org/sqlitedll-3_6_11.zip which > contains the dll and a definitions file. I have then used lib.exe to > generate a.lib file. The lib file is currently in C:\SQLITE\. > > > > I have done the following to alter the Linker configuration in the project: > > > > 1)Right Click Project -> Properties > > 2)Configuration Properties -> Linker > > 3)I entered "C:\SQLITE\" in the "Additional Library Directories" property > field > > > > I believe that I need a sqlite3 header file in order to use the functions > in my code. This is not included in the file I downloaded above. I have > thus downloaded http://www.sqlite.org/sqlite-amalgamation-3_6_11.zip and > taken sqlite3.h from this and added it to my project. > > > > I have only one source file in the project at present which is as > http://www.sqlite.org/quickstart.html. Trying to build throws up compile > errors about the exit keyword, so I have added #include as well. > > > > Now the project compiles without warnings or errors, but I see the > following Linker Errors: > > > > 1>MAIN.obj : error LNK2019: unresolved external symbol _sqlite3_free > referenced in function _main > > 1>MAIN.obj : error LNK2019: unresolved external symbol _sqlite3_exec > referenced in function _main > > 1>MAIN.obj : error LNK2019: unresolved external symbol _sqlite3_close > referenced in function _main > > 1>MAIN.obj : error LNK2019: unresolved external symbol _sqlite3_errmsg > referenced in function _main > > 1>MAIN.obj : error LNK2019: unresolved external symbol _sqlite3_open > referenced in function _main > > 1>*PATH*\Projects\Testing\SQLITE1\Debug\SQLITE1.exe > : fatal error LNK1120: 5 unresolved externals > > > > I have never worked with DLLs before so I could be something quite > fundamental wrong. > > > > Any help or thoughts would be welcome. > > > > Many thanks, > > > > Neil > > _ > View your Twitter and Flickr updates from one place – Learn more! > http://clk.atdmt.com/UKM/go/137984870/direct/01/ > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] First Program using sqlite3.dll - Linker Errors
Hi All, I am attempting to write a program which will use the sqlite3.dll file. I am developing in Visual Studio 2008 Express on Windows Vista. I downloaded this file: http://www.sqlite.org/sqlitedll-3_6_11.zip which contains the dll and a definitions file. I have then used lib.exe to generate a.lib file. The lib file is currently in C:\SQLITE\. I have done the following to alter the Linker configuration in the project: 1)Right Click Project -> Properties 2)Configuration Properties -> Linker 3)I entered "C:\SQLITE\" in the "Additional Library Directories" property field I believe that I need a sqlite3 header file in order to use the functions in my code. This is not included in the file I downloaded above. I have thus downloaded http://www.sqlite.org/sqlite-amalgamation-3_6_11.zip and taken sqlite3.h from this and added it to my project. I have only one source file in the project at present which is as http://www.sqlite.org/quickstart.html. Trying to build throws up compile errors about the exit keyword, so I have added #include as well. Now the project compiles without warnings or errors, but I see the following Linker Errors: 1>MAIN.obj : error LNK2019: unresolved external symbol _sqlite3_free referenced in function _main 1>MAIN.obj : error LNK2019: unresolved external symbol _sqlite3_exec referenced in function _main 1>MAIN.obj : error LNK2019: unresolved external symbol _sqlite3_close referenced in function _main 1>MAIN.obj : error LNK2019: unresolved external symbol _sqlite3_errmsg referenced in function _main 1>MAIN.obj : error LNK2019: unresolved external symbol _sqlite3_open referenced in function _main 1>*PATH*\Projects\Testing\SQLITE1\Debug\SQLITE1.exe : fatal error LNK1120: 5 unresolved externals I have never worked with DLLs before so I could be something quite fundamental wrong. Any help or thoughts would be welcome. Many thanks, Neil _ View your Twitter and Flickr updates from one place – Learn more! http://clk.atdmt.com/UKM/go/137984870/direct/01/ ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Source code position out of sync debugging in VS 2008
> I've already tried rebuilding everything, checked the settings, etc... but > nothing seems to help. I get the feeling this is a problem with the file > being so large and containing so many symbols. Has anyone else experienced > this problem? Indeed, the Visual Studio debugger can only handle 2^16 lines in a single source file. (The compiler has a more reasonable limit of 2^24 lines.) Some additional information in this thread: http://social.microsoft.com/Forums/en-US/vsdebug/thread/7d991493-06f7-45f6-8f34-165b988e266c ~Eric ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Source code position out of sync debugging in VS 2008
2009/3/28 Vinnie : > > I have added sqlite.c to my Visual Studio 2008 project and everything seems > to be working in terms of database calls. However, when I step into an actual > sqlite routine using the debugger, the source code position is out of sync > with the actual location. For example, I step into sqlite3_open_v2() and it > takes me to a completely unrelated source code line. > > I've already tried rebuilding everything, checked the settings, etc... but > nothing seems to help. I get the feeling this is a problem with the file > being so large and containing so many symbols. Has anyone else experienced > this problem? Yes I also get the feeling that it is due to the file size. Functions near the start of the file are ok to debug, those towards the end are not. > > Thanks > > My amalgamation was created on 2009-02-17 21:53:46 UTC Rgds, Simon ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] Source code position out of sync debugging in VS 2008
I have added sqlite.c to my Visual Studio 2008 project and everything seems to be working in terms of database calls. However, when I step into an actual sqlite routine using the debugger, the source code position is out of sync with the actual location. For example, I step into sqlite3_open_v2() and it takes me to a completely unrelated source code line. I've already tried rebuilding everything, checked the settings, etc... but nothing seems to help. I get the feeling this is a problem with the file being so large and containing so many symbols. Has anyone else experienced this problem? Thanks My amalgamation was created on 2009-02-17 21:53:46 UTC ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Unnecessary line breaks in .dump output
> > > Attachments don't make it through the mailing list, > Uhm, sorry. I'm new here. I don't want to paste the SQL script in an email, because it contains line breaks and I don't want the formatting to change during email transport. Try www.vwd.co.za/sqlitedump.zip regards, Francois ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Newbie what does & do.
On Sat, 28 Mar 2009 09:42:59 +, Dermot wrote: >2009/3/28 Jay A. Kreibich : >> On Fri, Mar 27, 2009 at 05:37:49PM +, Dermot scratched on the wall: >> >>> The statement is: >>> >>> SELECT COUNT(*) FROM products WHERE productid=808800033 AND >>> (allowcountry2 & 0x0001) >>> SELECT COUNT(*) FROM products WHERE productid=808800033 AND >>> (allowcountry1 & 0x8000) >>> >>> I believe the allowcountry part is a bit pattern lookup but I can't >>> find a definition for the & and so I am not sure what the statement >>> does bar count the results. >> >> To actually answer your question, yes, "&" in SQLite and some other >> DBs is a bitwise "and" operator, just like the C/C++ "&" operator. >> "|" is a bitwise "or". >> >> It is my understanding that these operators are not part of the >> SQL standard, but a number of databases implement the operator. > >First off, sorry it was such an off-topic question. Thank you Jay for >the answer. > >I can't find any reference to the ampersand's usage in my new book, my >copy of learning MySQL or the SQLite Syntax documentation. I would >have expected symbols to be listed before A in the index myself. There >are references to bitmap indices. Symbols refer to the BNF notation >but without reference to &. I have posted to SQLQueries. Hopefully I >can get an understanding of what that statement means from there. For future reference, here's an explanation of all binary operators, that is the -> [expr] -> (binary-operator) -> [expr] -> part of the expr BNF diagram on http://www.sqlite.org/lang_expr.html A few of those are bitwise. pre- ce- den- opera- ce toroperation -- --- 1|| concatenation 2* multiplication 2/ division 2% modulo (remainder of integer division) 3+ addition 3- subtraction 4<< bitwise shift left 4>> bitwise shift right 4& bitwise AND 4| bitwise OR 5< less than 5<= less than or equal 5> greater than 5>= greater than or equal 6= equal 6== equal 6!= not equal 6<> not equal 6IN subset of 6LIKE case insensitive equality with % and _ wildcards 6GLOB case sensitive equality with Unix style file globbing syntax 6MATCH reserved for user C function match() 6REGEXP reserved for user C function regexp() 7ANDboolean (logical) AND 8OR boolean (logical) OR (Note to the SQLite developers: I could put this in the wiki but it might be better to update the http://www.sqlite.org/lang_expr.html#binaryops page itself) > Again sorry for the post. No problem. >Dp. -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Newbie what does & do.
2009/3/28 Jay A. Kreibich : > On Fri, Mar 27, 2009 at 05:37:49PM +, Dermot scratched on the wall: > >> The statement is: >> >> SELECT COUNT(*) FROM products WHERE productid=808800033 AND >> (allowcountry2 & 0x0001) >> SELECT COUNT(*) FROM products WHERE productid=808800033 AND >> (allowcountry1 & 0x8000) >> >> I believe the allowcountry part is a bit pattern lookup but I can't >> find a definition for the & and so I am not sure what the statement >> does bar count the results. > > To actually answer your question, yes, "&" in SQLite and some other > DBs is a bitwise "and" operator, just like the C/C++ "&" operator. > "|" is a bitwise "or". > > It is my understanding that these operators are not part of the > SQL standard, but a number of databases implement the operator. First off, sorry it was such an off-topic question. Thank you Jay for the answer. I can't find any reference to the ampersand's usage in my new book, my copy of learning MySQL or the SQLite Syntax documentation. I would have expected symbols to be listed before A in the index myself. There are references to bitmap indices. Symbols refer to the BNF notation but without reference to &. I have posted to SQLQueries. Hopefully I can get an understanding of what that statement means from there. Again sorry for the post. Dp. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users