This leads me to agree with the person who suggested that a #define someplace is telling the precompiler to change "not" to something else. There is a compiler setting that will generate a file with an extension of ".i" that is the output of the precompiler. You could try doing that and seeing what that line is in there. Unfortunately, I don't remember what that compiler setting is.
I also like the idea of compiling sqlite3.c into a separate library. RobR -----Original Message----- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Marco Bambini Sent: Friday, March 30, 2012 8:33 AM To: General Discussion of SQLite Database Subject: Re: [sqlite] Visual Studio 2008 Express and sqlite3.c Please note that if I use the same compiler to compile sqlite3.c as a single c file than everything is compiled without errors. Errors occurs only when sqlite3.c is part of a c++ project. I also manually set sqlite3.c to be compiled as C file instead of Default without any luck. Seems like something confuse the Visual C++ compiler. Any idea? -- Marco Bambini http://www.sqlabs.com On Mar 30, 2012, at 1:08 PM, Nick Shaw wrote: > -----Original Message----- >> I am trying to compile the latest sqlite 3.7.11 amalgamation C file within a >> Visual Studio 2008 Express C++ project. >> sqlite3.c is correctly set as to be compiled as C code but I am unable to >> find out a way to fix some compilation errors: >> >> Compiling... >> sqlite3.c >> ..\Sources\sqlite3.c(107831) : error C2143: syntax error : missing ':' >> before '!' >> ..\Sources\sqlite3.c(107831) : error C2059: syntax error : ';' >> ..\Sources\sqlite3.c(107832) : error C2059: syntax error : '}' >> ..\Sources\sqlite3.c(107994) : error C2079: 'yy318' uses undefined struct >> 'LikeOp' >> ..\Sources\sqlite3.c(110530) : error C2224: left of '.eOperator' must have >> struct/union type >> ..\Sources\sqlite3.c(110530) : error C2059: syntax error : '!' >> ..\Sources\sqlite3.c(110534) : error C2224: left of '.eOperator' must have >> struct/union type >> ..\Sources\sqlite3.c(110534) : error C2059: syntax error : '!' >> ..\Sources\sqlite3.c(110538) : error C2275: 'ExprList' : illegal use of this >> type as an expression >> ..\Sources\sqlite3.c(8133) : see declaration of 'ExprList' >> ..\Sources\sqlite3.c(110541) : error C2224: left of '.eOperator' must have >> struct/union type >> ..\Sources\sqlite3.c(110541) : error C2198: 'sqlite3ExprFunction' : too few >> arguments for call >> ..\Sources\sqlite3.c(110542) : error C2059: syntax error : '!' >> ..\Sources\sqlite3.c(110554) : error C2224: left of '.eOperator' must have >> struct/union type >> ..\Sources\sqlite3.c(110554) : error C2198: 'sqlite3ExprFunction' : too few >> arguments for call >> ..\Sources\sqlite3.c(110555) : error C2059: syntax error : '!' > > Looks like something's not right with the definition of the LikeOp struct in > your copy of the file. I've got the exact same amalgamation in my VS2008 > project and it builds fine. Can you check what you have for the LikeOp > structure definition? Mine looks like this, and starts on line 107829: > > struct LikeOp { > Token eOperator; /* "like" or "glob" or "regexp" */ > int not; /* True if the NOT keyword is present */ > }; > > > Thanks, > Nick. > -- > _______________________________________________ > 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