Re[2]: [sqlite] trying to compile SQLite

2004-08-31 Thread Jonathan Gennick
Tuesday, August 31, 2004, 1:03:38 PM, Doug Currie ([EMAIL PROTECTED]) wrote:
DC> This is the SQLite 2 API... are you intending to use SQLite 2 or 3?

I download everything in early summer, and probably have
2.8. I hadn't noticed 3 was out. Guess I should upgrade
 
Best regards,

Jonathan Gennick
Editor, O'Reilly & Associates
906.387.1698   mailto:[EMAIL PROTECTED]



Re[2]: [sqlite] trying to compile SQLite

2004-08-31 Thread Jonathan Gennick
CS> Oops, you've pasted the source twice, so we haven't got the errors:)

Oh my. You know, that happens to me quite often, on both my
Windows boxes. I hit ctrl-C, and it's like it doesn't
register. My alt keystrokes, from alt-tab sequences, get
eaten sometimes too. But let's not worry about *that*
problem. It's probably some bizarre Windows setting that I
checked once upon a time.

CS> From the source, you don't appear to include sqlite.h, but do include
CS> main.c! A typo? If your main file is called main.c, you'll get a recursive
CS> include, which will break the compile.

Well, I wasn't sure what to include, so I went with main.c.
My main file was main.cc, so I don't know whether I was
getting any sort of recursive include from that or not. It
didn't appear so. HOWEVER, including sqlite.h makes a BIG
difference. I've still got some errors to work through, but
now they are in code that I myself have written, and I think
I can work through them. Let me try at least, before I post
back here.

Thanks for your help, and that goes for everyone who posted.
I haven't caught up with all the replies yet.
 
Best regards,

Jonathan Gennick
Editor, O'Reilly & Associates
906.387.1698   mailto:[EMAIL PROTECTED]

Tuesday, August 31, 2004, 12:54:52 PM, Christian Smith ([EMAIL PROTECTED]) wrote:
CS> 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.


CS> Oops, you've pasted the source twice, so we haven't got the errors:)

CS> Without the errors, It's hard to hazard a guess. I assume you're using
CS> SQLite 2.8.x

>>From the source, you don't appear to include sqlite.h, but do include
CS> main.c! A typo? If your main file is called main.c, you'll get a recursive
CS> 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.


CS> I believe the dll from the website is cross-compiled using mingw32 under
CS> Linux, though I could be wrong. If in doubt, use the Windows binary from
CS> 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.


CS> 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 
>>#include 
>>#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, );
>>  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 
>>#include 
>>#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, );
>>  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;
>>}
>>



[sqlite] trying to compile SQLite

2004-08-31 Thread Jonathan Gennick
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.

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.

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.

Best regards,

Jonathan Gennick
Editor, O'Reilly & Associates
906.387.1698   mailto:[EMAIL PROTECTED]


Here's the code I'm trying to compile:

#include 
#include 
#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, );
  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 
#include 
#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, );
  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;
}