On Tue, 31 Aug 2004, Jonathan Gennick wrote: >I'm trying to compile SQLite, but, unfortunately, with very >little joy. I'm running on Windows (sorry), and I'm using >Bloodshed's C++ IDE, which appears to run some form of GNU's >C++ compiler. Is anyone else using this particular >combination? > >Below my signature, I've pasted in the short program that >I'm trying to compile. I've also pasted in the error >messages that result. I'd be grateful for any help.
Oops, you've pasted the source twice, so we haven't got the errors:) Without the errors, It's hard to hazard a guess. I assume you're using SQLite 2.8.x >From the source, you don't appear to include sqlite.h, but do include main.c! A typo? If your main file is called main.c, you'll get a recursive include, which will break the compile. > >If not Bloodshed, is there some other Windows C++ compiler that is >known to be able to compile SQLite? I'd be happy to switch >compilers, if that was the easiest way for me to get to some >working code. I believe the dll from the website is cross-compiled using mingw32 under Linux, though I could be wrong. If in doubt, use the Windows binary from the website until you've sorted your build problem. > >Of course, it could be my code that is flawed, and not the >compiler, but the errors all appear come from SQLite source >files, so I tend to think I'm encountering some sort of >mismatch between SQLite and the compiler that I'm using. See include diagnosis above. > >Best regards, > >Jonathan Gennick >Editor, O'Reilly & Associates >906.387.1698 mailto:[EMAIL PROTECTED] > > >Here's the code I'm trying to compile: > >#include <iostream> >#include <stdlib.h> >#include "main.c" > >using namespace std; > >int main(int argc, char *argv[]) >{ > sqlite *db; > char *zErrMsg = 0; > int rc; > > printf("Opening the database...\n\n"); > db = sqlite_open("c:\SQLite\Projects|FirstTest\FirstDatabase", 0, &zErrMsg); > if( db==0 ){ > fprintf(stderr, "Can't open database: %s\n", zErrMsg); > system("PAUSE"); > exit(1); > } > > printf("Closing the database...\n\n"); > sqlite_close(db); > > system("PAUSE"); > return 0; >} > > >And here are the results: > >#include <iostream> >#include <stdlib.h> >#include "main.c" > >using namespace std; > >int main(int argc, char *argv[]) >{ > sqlite *db; > char *zErrMsg = 0; > int rc; > > printf("Opening the database...\n\n"); > db = sqlite_open("c:\SQLite\Projects|FirstTest\FirstDatabase", 0, &zErrMsg); > if( db==0 ){ > fprintf(stderr, "Can't open database: %s\n", zErrMsg); > system("PAUSE"); > exit(1); > } > > printf("Closing the database...\n\n"); > sqlite_close(db); > > system("PAUSE"); > return 0; >} > -- /"\ \ / ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL X - AGAINST MS ATTACHMENTS / \