Need setup code for VC++ 2017 that will ACTUALLY COMPILE

classic Classic list List threaded Threaded
28 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Need setup code for VC++ 2017 that will ACTUALLY COMPILE

zydeholic
Hello folks,
I looked through the last few months of posts in the archive, and no subject lines seemed to cover this.
I've tried a couple of CPPSqlite3.cpp and .h from github.com.I've tried code from a couple of websites.
NOTHING seems to compile all the way through. 

I'm using Visual Studio 2017 C++.  I'm on a WIndows 10 machine.  64bit, but compiling 32 bit.
I tried Code::Blocks and got different, but equally incomplete compiles.

I've included <fstream> in the includes.  I've downloaded sqlite3.c and .h.
Nothing seems to work.  Is there ANYWHERE that offers a step-by-step solution to this that WILL COMPILE all the way through.
I'm sure this has been covered before, but I did not see a way to search the entire archives.  Any help appreciated.
Thanks.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Need setup code for VC++ 2017 that will ACTUALLY COMPILE

Donald Shepherd
You'll need to provide more information, speaking as someone who compiles
the amalgamation off the SQLite website with VC++ 2017 on Windows 10 with
no issues.  SQLite is C code, not C++ code, but VC++ detects that based off
the file extension and compiles it as such.

Trying to use whatever "CPPSqlite3.cpp" is and adding C++ headers is not
likely to get you anywhere unless you follow up with whoever created those
files for assistance.

Regards,
Donald Shepherd.

On Fri, 21 Dec 2018 at 09:41, zydeholic <[hidden email]> wrote:

> Hello folks,
> I looked through the last few months of posts in the archive, and no
> subject lines seemed to cover this.
> I've tried a couple of CPPSqlite3.cpp and .h from github.com.I've tried
> code from a couple of websites.
> NOTHING seems to compile all the way through.
>
> I'm using Visual Studio 2017 C++.  I'm on a WIndows 10 machine.  64bit,
> but compiling 32 bit.
> I tried Code::Blocks and got different, but equally incomplete compiles.
>
> I've included <fstream> in the includes.  I've downloaded sqlite3.c and .h.
> Nothing seems to work.  Is there ANYWHERE that offers a step-by-step
> solution to this that WILL COMPILE all the way through.
> I'm sure this has been covered before, but I did not see a way to search
> the entire archives.  Any help appreciated.
> Thanks.
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Need setup code for VC++ 2017 that will ACTUALLY COMPILE

Igor Korot
Hi,
Unfortunately you didn't tell what did you try to compile, where did
you get the files you tried to compile from and
you didn't even supply the error message you received from the compilation.

Please follow-up and provide this and hopefully someone here will be
able to help.

Thank you.

On Thu, Dec 20, 2018 at 5:17 PM Donald Shepherd
<[hidden email]> wrote:

>
> You'll need to provide more information, speaking as someone who compiles
> the amalgamation off the SQLite website with VC++ 2017 on Windows 10 with
> no issues.  SQLite is C code, not C++ code, but VC++ detects that based off
> the file extension and compiles it as such.
>
> Trying to use whatever "CPPSqlite3.cpp" is and adding C++ headers is not
> likely to get you anywhere unless you follow up with whoever created those
> files for assistance.
>
> Regards,
> Donald Shepherd.
>
> On Fri, 21 Dec 2018 at 09:41, zydeholic <[hidden email]> wrote:
>
> > Hello folks,
> > I looked through the last few months of posts in the archive, and no
> > subject lines seemed to cover this.
> > I've tried a couple of CPPSqlite3.cpp and .h from github.com.I've tried
> > code from a couple of websites.
> > NOTHING seems to compile all the way through.
> >
> > I'm using Visual Studio 2017 C++.  I'm on a WIndows 10 machine.  64bit,
> > but compiling 32 bit.
> > I tried Code::Blocks and got different, but equally incomplete compiles.
> >
> > I've included <fstream> in the includes.  I've downloaded sqlite3.c and .h.
> > Nothing seems to work.  Is there ANYWHERE that offers a step-by-step
> > solution to this that WILL COMPILE all the way through.
> > I'm sure this has been covered before, but I did not see a way to search
> > the entire archives.  Any help appreciated.
> > Thanks.
> > _______________________________________________
> > sqlite-users mailing list
> > [hidden email]
> > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
> >
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Need setup code for VC++ 2017 that will ACTUALLY COMPILE

Scott Doctor

Click the link.

https://sqlite.org/download.html

Download the amalgamation zip file.

Unzip to your files directory. Should be two files. sqlite.c and
sqlite.h

Add #include "sqlite.h" to your file.

Compile.


-------------------------
Scott Doctor
[hidden email]
-------------------------

On 12/20/2018 15:34, Igor Korot wrote:

> Hi,
> Unfortunately you didn't tell what did you try to compile, where did
> you get the files you tried to compile from and
> you didn't even supply the error message you received from the compilation.
>
> Please follow-up and provide this and hopefully someone here will be
> able to help.
>
> Thank you.
>
> On Thu, Dec 20, 2018 at 5:17 PM Donald Shepherd
> <[hidden email]> wrote:
>> You'll need to provide more information, speaking as someone who compiles
>> the amalgamation off the SQLite website with VC++ 2017 on Windows 10 with
>> no issues.  SQLite is C code, not C++ code, but VC++ detects that based off
>> the file extension and compiles it as such.
>>
>> Trying to use whatever "CPPSqlite3.cpp" is and adding C++ headers is not
>> likely to get you anywhere unless you follow up with whoever created those
>> files for assistance.
>>
>> Regards,
>> Donald Shepherd.
>>
>> On Fri, 21 Dec 2018 at 09:41, zydeholic <[hidden email]> wrote:
>>
>>> Hello folks,
>>> I looked through the last few months of posts in the archive, and no
>>> subject lines seemed to cover this.
>>> I've tried a couple of CPPSqlite3.cpp and .h from github.com.I've tried
>>> code from a couple of websites.
>>> NOTHING seems to compile all the way through.
>>>
>>> I'm using Visual Studio 2017 C++.  I'm on a WIndows 10 machine.  64bit,
>>> but compiling 32 bit.
>>> I tried Code::Blocks and got different, but equally incomplete compiles.
>>>
>>> I've included <fstream> in the includes.  I've downloaded sqlite3.c and .h.
>>> Nothing seems to work.  Is there ANYWHERE that offers a step-by-step
>>> solution to this that WILL COMPILE all the way through.
>>> I'm sure this has been covered before, but I did not see a way to search
>>> the entire archives.  Any help appreciated.
>>> Thanks.
>>> _______________________________________________
>>> sqlite-users mailing list
>>> [hidden email]
>>> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>>>
>> _______________________________________________
>> sqlite-users mailing list
>> [hidden email]
>> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Need setup code for VC++ 2017 that will ACTUALLY COMPILE

zydeholic
In reply to this post by zydeholic
Ok, sorry for my thrashing.  I get frustrated when I don't know what's happening, even when I follow directions from a website.  And I tried several things and couldn't remember what errors I got from what venture.



To Scott Doctor,
I pulled the two files into a C++ project, deleted the .cpp file, and compiled.
It came back and said my PCH compiled header was from a previous project, or something like that.  I tried to save the message, but it got lost in the hubbub.
So, I deleted the PCH.CPP file that was in the project.  I just rebuilt it, and got this message:

Error    C1010    unexpected end of file while looking for precompiled header. Did you forget to add '#include "pch.h"' to your source?    sqlite_c    c:\sqlite\source code\sqlite-amalgamation-3260000\sqlite3.c    220536   

even though I have #include "pch.h" in both of my .c and .h files. 

Any pointers appreciated.  Thanks.


      From: zydeholic <[hidden email]>
 To: "[hidden email]" <[hidden email]>
 Sent: Thursday, December 20, 2018 2:41 PM
 Subject: Need setup code for VC++ 2017 that will ACTUALLY COMPILE
   
Hello folks,
I looked through the last few months of posts in the archive, and no subject lines seemed to cover this.
I've tried a couple of CPPSqlite3.cpp and .h from github.com.I've tried code from a couple of websites.
NOTHING seems to compile all the way through. 

I'm using Visual Studio 2017 C++.  I'm on a WIndows 10 machine.  64bit, but compiling 32 bit.
I tried Code::Blocks and got different, but equally incomplete compiles.

I've included <fstream> in the includes.  I've downloaded sqlite3.c and .h.
Nothing seems to work.  Is there ANYWHERE that offers a step-by-step solution to this that WILL COMPILE all the way through.
I'm sure this has been covered before, but I did not see a way to search the entire archives.  Any help appreciated.
Thanks.


   
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Need setup code for VC++ 2017 that will ACTUALLY COMPILE

Donald Shepherd
PCH/precompiled headers are not related to SQLite.  You can try disabling
them or looking in how to fix them separately.

Regards,
Donald Shepherd.

On Fri, 21 Dec 2018 at 12:34, zydeholic <[hidden email]> wrote:

> Ok, sorry for my thrashing.  I get frustrated when I don't know what's
> happening, even when I follow directions from a website.  And I tried
> several things and couldn't remember what errors I got from what venture.
>
>
>
> To Scott Doctor,
> I pulled the two files into a C++ project, deleted the .cpp file, and
> compiled.
> It came back and said my PCH compiled header was from a previous project,
> or something like that.  I tried to save the message, but it got lost in
> the hubbub.
> So, I deleted the PCH.CPP file that was in the project.  I just rebuilt
> it, and got this message:
>
> Error    C1010    unexpected end of file while looking for precompiled
> header. Did you forget to add '#include "pch.h"' to your source?
> sqlite_c    c:\sqlite\source code\sqlite-amalgamation-3260000\sqlite3.c
> 220536
>
> even though I have #include "pch.h" in both of my .c and .h files.
>
> Any pointers appreciated.  Thanks.
>
>
>       From: zydeholic <[hidden email]>
>  To: "[hidden email]" <
> [hidden email]>
>  Sent: Thursday, December 20, 2018 2:41 PM
>  Subject: Need setup code for VC++ 2017 that will ACTUALLY COMPILE
>
> Hello folks,
> I looked through the last few months of posts in the archive, and no
> subject lines seemed to cover this.
> I've tried a couple of CPPSqlite3.cpp and .h from github.com.I've tried
> code from a couple of websites.
> NOTHING seems to compile all the way through.
>
> I'm using Visual Studio 2017 C++.  I'm on a WIndows 10 machine.  64bit,
> but compiling 32 bit.
> I tried Code::Blocks and got different, but equally incomplete compiles.
>
> I've included <fstream> in the includes.  I've downloaded sqlite3.c and .h.
> Nothing seems to work.  Is there ANYWHERE that offers a step-by-step
> solution to this that WILL COMPILE all the way through.
> I'm sure this has been covered before, but I did not see a way to search
> the entire archives.  Any help appreciated.
> Thanks.
>
>
>
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Need setup code for VC++ 2017 that will ACTUALLY COMPILE

zydeholic
In reply to this post by zydeholic
Trying again, importing the sqlite3.h and sqlite3.c files directly into the subdirectory created by VC++, and running:

Severity    Code    Description    Project    File    Line    Suppression State
Error    C1853    'Debug\sqlite_try_3.pch' precompiled header file is from a previous version of the compiler, or the precompiled header is C++ and you are using it from C (or vice versa)    sqlite_try_3    c:\users\dsnos\source\repos\sqlite_try_3\sqlite_try_3\sqlite3.c    1   


      From: zydeholic <[hidden email]>
 To: "[hidden email]" <[hidden email]>
 Sent: Thursday, December 20, 2018 5:34 PM
 Subject: Re: Need setup code for VC++ 2017 that will ACTUALLY COMPILE
   
Ok, sorry for my thrashing.  I get frustrated when I don't know what's happening, even when I follow directions from a website.  And I tried several things and couldn't remember what errors I got from what venture.



To Scott Doctor,
I pulled the two files into a C++ project, deleted the .cpp file, and compiled.
It came back and said my PCH compiled header was from a previous project, or something like that.  I tried to save the message, but it got lost in the hubbub.
So, I deleted the PCH.CPP file that was in the project.  I just rebuilt it, and got this message:

Error    C1010    unexpected end of file while looking for precompiled header. Did you forget to add '#include "pch.h"' to your source?    sqlite_c    c:\sqlite\source code\sqlite-amalgamation-3260000\sqlite3.c    220536   

even though I have #include "pch.h" in both of my .c and .h files. 

Any pointers appreciated.  Thanks.


      From: zydeholic <[hidden email]>
 To: "[hidden email]" <[hidden email]>
 Sent: Thursday, December 20, 2018 2:41 PM
 Subject: Need setup code for VC++ 2017 that will ACTUALLY COMPILE
 
Hello folks,
I looked through the last few months of posts in the archive, and no subject lines seemed to cover this.
I've tried a couple of CPPSqlite3.cpp and .h from github.com.I've tried code from a couple of websites.
NOTHING seems to compile all the way through. 

I'm using Visual Studio 2017 C++.  I'm on a WIndows 10 machine.  64bit, but compiling 32 bit.
I tried Code::Blocks and got different, but equally incomplete compiles.

I've included <fstream> in the includes.  I've downloaded sqlite3.c and .h.
Nothing seems to work.  Is there ANYWHERE that offers a step-by-step solution to this that WILL COMPILE all the way through.
I'm sure this has been covered before, but I did not see a way to search the entire archives.  Any help appreciated.
Thanks.


   

   
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Need setup code for VC++ 2017 that will ACTUALLY COMPILE

Jens Alfke-2
In reply to this post by zydeholic


> On Dec 20, 2018, at 5:34 PM, zydeholic <[hidden email]> wrote:
>
> I pulled the two files into a C++ project, deleted the .cpp file, and compiled.
> It came back and said my PCH compiled header was from a previous project, or something like that.  I tried to save the message, but it got lost in the hubbub.
> So, I deleted the PCH.CPP file that was in the project.  I just rebuilt it, and got this message:
>
> Error    C1010    unexpected end of file while looking for precompiled header. Did you forget to add '#include "pch.h"' to your source?    sqlite_c    c:\sqlite\source code\sqlite-amalgamation-3260000\sqlite3.c    220536    

You’re having trouble with Visual Studio, not with SQLite. A forum for VS users would be an appropriate place to ask for help.

—Jens
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Need setup code for VC++ 2017 that will ACTUALLY COMPILE

zydeholic
In reply to this post by zydeholic
To Donald Shepard,
Sorry, I'm on digest and am having to just respond to my own messages for now.  Just told it to get me off of digest.
Regarding PCH, VC++ seems to be forcing me into that situation (yes, I'm relatively new to C++ and the ins and outs of VS).
If I don't include the pch.h in my files, it won't compile and comes back and asks me if I forgot them. 

So, any pointers on how to slide through that problem would be great.  Thanks for your and everyone else's time.



      From: zydeholic <[hidden email]>
 To: "[hidden email]" <[hidden email]>
 Sent: Thursday, December 20, 2018 5:57 PM
 Subject: Re: Need setup code for VC++ 2017 that will ACTUALLY COMPILE
   
Trying again, importing the sqlite3.h and sqlite3.c files directly into the subdirectory created by VC++, and running:

Severity    Code    Description    Project    File    Line    Suppression State
Error    C1853    'Debug\sqlite_try_3.pch' precompiled header file is from a previous version of the compiler, or the precompiled header is C++ and you are using it from C (or vice versa)    sqlite_try_3    c:\users\dsnos\source\repos\sqlite_try_3\sqlite_try_3\sqlite3.c    1   


      From: zydeholic <[hidden email]>
 To: "[hidden email]" <[hidden email]>
 Sent: Thursday, December 20, 2018 5:34 PM
 Subject: Re: Need setup code for VC++ 2017 that will ACTUALLY COMPILE
 
Ok, sorry for my thrashing.  I get frustrated when I don't know what's happening, even when I follow directions from a website.  And I tried several things and couldn't remember what errors I got from what venture.



To Scott Doctor,
I pulled the two files into a C++ project, deleted the .cpp file, and compiled.
It came back and said my PCH compiled header was from a previous project, or something like that.  I tried to save the message, but it got lost in the hubbub.
So, I deleted the PCH.CPP file that was in the project.  I just rebuilt it, and got this message:

Error    C1010    unexpected end of file while looking for precompiled header. Did you forget to add '#include "pch.h"' to your source?    sqlite_c    c:\sqlite\source code\sqlite-amalgamation-3260000\sqlite3.c    220536   

even though I have #include "pch.h" in both of my .c and .h files. 

Any pointers appreciated.  Thanks.


      From: zydeholic <[hidden email]>
 To: "[hidden email]" <[hidden email]>
 Sent: Thursday, December 20, 2018 2:41 PM
 Subject: Need setup code for VC++ 2017 that will ACTUALLY COMPILE
 
Hello folks,
I looked through the last few months of posts in the archive, and no subject lines seemed to cover this.
I've tried a couple of CPPSqlite3.cpp and .h from github.com.I've tried code from a couple of websites.
NOTHING seems to compile all the way through. 

I'm using Visual Studio 2017 C++.  I'm on a WIndows 10 machine.  64bit, but compiling 32 bit.
I tried Code::Blocks and got different, but equally incomplete compiles.

I've included <fstream> in the includes.  I've downloaded sqlite3.c and .h.
Nothing seems to work.  Is there ANYWHERE that offers a step-by-step solution to this that WILL COMPILE all the way through.
I'm sure this has been covered before, but I did not see a way to search the entire archives.  Any help appreciated.
Thanks.


   

   

   
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Need setup code for VC++ 2017 that will ACTUALLY COMPILE

zydeholic-2
In reply to this post by Jens Alfke-2
Thanks.  Perhaps you're right, but then they probably won't know much about sqlite, and I'll be at another dead end.  And someone on here just said they used VC++ all the time for this, so perhaps they can point me in the right direction.

      From: Jens Alfke <[hidden email]>
 To: SQLite mailing list <[hidden email]>
 Sent: Thursday, December 20, 2018 5:59 PM
 Subject: Re: [sqlite] Need setup code for VC++ 2017 that will ACTUALLY COMPILE
   


> On Dec 20, 2018, at 5:34 PM, zydeholic <[hidden email]> wrote:
>
> I pulled the two files into a C++ project, deleted the .cpp file, and compiled.
> It came back and said my PCH compiled header was from a previous project, or something like that.  I tried to save the message, but it got lost in the hubbub.
> So, I deleted the PCH.CPP file that was in the project.  I just rebuilt it, and got this message:
>
> Error    C1010    unexpected end of file while looking for precompiled header. Did you forget to add '#include "pch.h"' to your source?    sqlite_c    c:\sqlite\source code\sqlite-amalgamation-3260000\sqlite3.c    220536   

You’re having trouble with Visual Studio, not with SQLite. A forum for VS users would be an appropriate place to ask for help.

—Jens
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


   
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Need setup code for VC++ 2017 that will ACTUALLY COMPILE

Donald Shepherd
In reply to this post by zydeholic
https://stackoverflow.com/questions/7261707/how-to-avoid-precompiled-headers


On Fri., 21 Dec. 2018, 1:02 pm zydeholic <[hidden email] wrote:

> To Donald Shepard,
> Sorry, I'm on digest and am having to just respond to my own messages for
> now.  Just told it to get me off of digest.
> Regarding PCH, VC++ seems to be forcing me into that situation (yes, I'm
> relatively new to C++ and the ins and outs of VS).
> If I don't include the pch.h in my files, it won't compile and comes back
> and asks me if I forgot them.
>
> So, any pointers on how to slide through that problem would be great.
> Thanks for your and everyone else's time.
>
>
>
>       From: zydeholic <[hidden email]>
>  To: "[hidden email]" <
> [hidden email]>
>  Sent: Thursday, December 20, 2018 5:57 PM
>  Subject: Re: Need setup code for VC++ 2017 that will ACTUALLY COMPILE
>
> Trying again, importing the sqlite3.h and sqlite3.c files directly into
> the subdirectory created by VC++, and running:
>
> Severity    Code    Description    Project    File    Line    Suppression
> State
> Error    C1853    'Debug\sqlite_try_3.pch' precompiled header file is from
> a previous version of the compiler, or the precompiled header is C++ and
> you are using it from C (or vice versa)    sqlite_try_3
> c:\users\dsnos\source\repos\sqlite_try_3\sqlite_try_3\sqlite3.c    1
>
>
>       From: zydeholic <[hidden email]>
>  To: "[hidden email]" <
> [hidden email]>
>  Sent: Thursday, December 20, 2018 5:34 PM
>  Subject: Re: Need setup code for VC++ 2017 that will ACTUALLY COMPILE
>
> Ok, sorry for my thrashing.  I get frustrated when I don't know what's
> happening, even when I follow directions from a website.  And I tried
> several things and couldn't remember what errors I got from what venture.
>
>
>
> To Scott Doctor,
> I pulled the two files into a C++ project, deleted the .cpp file, and
> compiled.
> It came back and said my PCH compiled header was from a previous project,
> or something like that.  I tried to save the message, but it got lost in
> the hubbub.
> So, I deleted the PCH.CPP file that was in the project.  I just rebuilt
> it, and got this message:
>
> Error    C1010    unexpected end of file while looking for precompiled
> header. Did you forget to add '#include "pch.h"' to your source?
> sqlite_c    c:\sqlite\source code\sqlite-amalgamation-3260000\sqlite3.c
> 220536
>
> even though I have #include "pch.h" in both of my .c and .h files.
>
> Any pointers appreciated.  Thanks.
>
>
>       From: zydeholic <[hidden email]>
>  To: "[hidden email]" <
> [hidden email]>
>  Sent: Thursday, December 20, 2018 2:41 PM
>  Subject: Need setup code for VC++ 2017 that will ACTUALLY COMPILE
>
> Hello folks,
> I looked through the last few months of posts in the archive, and no
> subject lines seemed to cover this.
> I've tried a couple of CPPSqlite3.cpp and .h from github.com.I've tried
> code from a couple of websites.
> NOTHING seems to compile all the way through.
>
> I'm using Visual Studio 2017 C++.  I'm on a WIndows 10 machine.  64bit,
> but compiling 32 bit.
> I tried Code::Blocks and got different, but equally incomplete compiles.
>
> I've included <fstream> in the includes.  I've downloaded sqlite3.c and .h.
> Nothing seems to work.  Is there ANYWHERE that offers a step-by-step
> solution to this that WILL COMPILE all the way through.
> I'm sure this has been covered before, but I did not see a way to search
> the entire archives.  Any help appreciated.
> Thanks.
>
>
>
>
>
>
>
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Need setup code for VC++ 2017 that will ACTUALLY COMPILE

zydeholic
Thank you, Donald.  I found something similar in a search, after someone pointed out my problem was VC++.   I went and set PCH off for both my C and CPP files.


I no longer get the PCH messages.  I now get this error:
Severity    Code    Description    Project    File    Line    Suppression State
Error    LNK2001    unresolved external symbol _sqlite3_version    sqlite_try_3    C:\Users\DSNoS\source\repos\sqlite_try_3\sqlite_try_3\sqlite3.obj    1   

Clicking on the error does not bring me to a line in the code.

      From: Donald Shepherd <[hidden email]>
 To: General Discussion of SQLite Database <[hidden email]>
 Sent: Thursday, December 20, 2018 6:09 PM
 Subject: Re: [sqlite] Need setup code for VC++ 2017 that will ACTUALLY COMPILE
 
https://stackoverflow.com/questions/7261707/how-to-avoid-precompiled-headers


On Fri., 21 Dec. 2018, 1:02 pm zydeholic <[hidden email] wrote:

> To Donald Shepard,
> Sorry, I'm on digest and am having to just respond to my own messages for
> now.  Just told it to get me off of digest.
> Regarding PCH, VC++ seems to be forcing me into that situation (yes, I'm
> relatively new to C++ and the ins and outs of VS).
> If I don't include the pch.h in my files, it won't compile and comes back
> and asks me if I forgot them.
>
> So, any pointers on how to slide through that problem would be great.
> Thanks for your and everyone else's time.
>
>
>
>      From: zydeholic <[hidden email]>
>  To: "[hidden email]" <
> [hidden email]>
>  Sent: Thursday, December 20, 2018 5:57 PM
>  Subject: Re: Need setup code for VC++ 2017 that will ACTUALLY COMPILE
>
> Trying again, importing the sqlite3.h and sqlite3.c files directly into
> the subdirectory created by VC++, and running:
>
> Severity    Code    Description    Project    File    Line    Suppression
> State
> Error    C1853    'Debug\sqlite_try_3.pch' precompiled header file is from
> a previous version of the compiler, or the precompiled header is C++ and
> you are using it from C (or vice versa)    sqlite_try_3
> c:\users\dsnos\source\repos\sqlite_try_3\sqlite_try_3\sqlite3.c    1
>
>
>      From: zydeholic <[hidden email]>
>  To: "[hidden email]" <
> [hidden email]>
>  Sent: Thursday, December 20, 2018 5:34 PM
>  Subject: Re: Need setup code for VC++ 2017 that will ACTUALLY COMPILE
>
> Ok, sorry for my thrashing.  I get frustrated when I don't know what's
> happening, even when I follow directions from a website.  And I tried
> several things and couldn't remember what errors I got from what venture.
>
>
>
> To Scott Doctor,
> I pulled the two files into a C++ project, deleted the .cpp file, and
> compiled.
> It came back and said my PCH compiled header was from a previous project,
> or something like that.  I tried to save the message, but it got lost in
> the hubbub.
> So, I deleted the PCH.CPP file that was in the project.  I just rebuilt
> it, and got this message:
>
> Error    C1010    unexpected end of file while looking for precompiled
> header. Did you forget to add '#include "pch.h"' to your source?
> sqlite_c    c:\sqlite\source code\sqlite-amalgamation-3260000\sqlite3.c
> 220536
>
> even though I have #include "pch.h" in both of my .c and .h files.
>
> Any pointers appreciated.  Thanks.
>
>
>      From: zydeholic <[hidden email]>
>  To: "[hidden email]" <
> [hidden email]>
>  Sent: Thursday, December 20, 2018 2:41 PM
>  Subject: Need setup code for VC++ 2017 that will ACTUALLY COMPILE
>
> Hello folks,
> I looked through the last few months of posts in the archive, and no
> subject lines seemed to cover this.
> I've tried a couple of CPPSqlite3.cpp and .h from github.com.I've tried
> code from a couple of websites.
> NOTHING seems to compile all the way through.
>
> I'm using Visual Studio 2017 C++.  I'm on a WIndows 10 machine.  64bit,
> but compiling 32 bit.
> I tried Code::Blocks and got different, but equally incomplete compiles.
>
> I've included <fstream> in the includes.  I've downloaded sqlite3.c and .h.
> Nothing seems to work.  Is there ANYWHERE that offers a step-by-step
> solution to this that WILL COMPILE all the way through.
> I'm sure this has been covered before, but I did not see a way to search
> the entire archives.  Any help appreciated.
> Thanks.
>
>
>
>
>
>
>
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


   

   
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Need setup code for VC++ 2017 that will ACTUALLY COMPILE

Deon Brewis
In reply to this post by Jens Alfke-2
Right-click on the sqlite3.c file in your Visual Studio project, click on properties, then under C/C++ go to Precompiled Headers, and change the setting for "Precompiled Header" to "Not using precompiled header".

Make sure to do this for "All Configurations" and "All Platforms" (at the top of that dialog).

- Deon

-----Original Message-----
From: sqlite-users <[hidden email]> On Behalf Of Jens Alfke
Sent: Thursday, December 20, 2018 5:59 PM
To: SQLite mailing list <[hidden email]>
Subject: Re: [sqlite] Need setup code for VC++ 2017 that will ACTUALLY COMPILE



> On Dec 20, 2018, at 5:34 PM, zydeholic <[hidden email]> wrote:
>
> I pulled the two files into a C++ project, deleted the .cpp file, and compiled.
> It came back and said my PCH compiled header was from a previous project, or something like that.  I tried to save the message, but it got lost in the hubbub.
> So, I deleted the PCH.CPP file that was in the project.  I just rebuilt it, and got this message:
>
> Error    C1010    unexpected end of file while looking for precompiled header. Did you forget to add '#include "pch.h"' to your source?    sqlite_c    c:\sqlite\source code\sqlite-amalgamation-3260000\sqlite3.c    220536    

You’re having trouble with Visual Studio, not with SQLite. A forum for VS users would be an appropriate place to ask for help.

—Jens
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Need setup code for VC++ 2017 that will ACTUALLY COMPILE

zydeholic
Thanks for responding Deon,
Ok, I took the two sqlite3.c and sqlite3.h files, fresh from an amalgamation extract, put them in the project, and set .c to "Not using precompiled header", All platforms, all configurations.

I compile and get one error:
Severity    Code    Description    Project    File    Line    Suppression State
Error    LNK2001    unresolved external symbol _sqlite3_version    sqlite_try_3    C:\Users\DSNoS\source\repos\sqlite_try_3\sqlite_try_3\sqlite3.obj    1    




      From: Deon Brewis <[hidden email]>
 To: SQLite mailing list <[hidden email]>
 Sent: Friday, December 21, 2018 8:03 AM
 Subject: Re: [sqlite] Need setup code for VC++ 2017 that will ACTUALLY COMPILE
   
Right-click on the sqlite3.c file in your Visual Studio project, click on properties, then under C/C++ go to Precompiled Headers, and change the setting for "Precompiled Header" to "Not using precompiled header".

Make sure to do this for "All Configurations" and "All Platforms" (at the top of that dialog).

- Deon

-----Original Message-----
From: sqlite-users <[hidden email]> On Behalf Of Jens Alfke
Sent: Thursday, December 20, 2018 5:59 PM
To: SQLite mailing list <[hidden email]>
Subject: Re: [sqlite] Need setup code for VC++ 2017 that will ACTUALLY COMPILE



> On Dec 20, 2018, at 5:34 PM, zydeholic <[hidden email]> wrote:
>
> I pulled the two files into a C++ project, deleted the .cpp file, and compiled.
> It came back and said my PCH compiled header was from a previous project, or something like that.  I tried to save the message, but it got lost in the hubbub.
> So, I deleted the PCH.CPP file that was in the project.  I just rebuilt it, and got this message:
>
> Error    C1010    unexpected end of file while looking for precompiled header. Did you forget to add '#include "pch.h"' to your source?    sqlite_c    c:\sqlite\source code\sqlite-amalgamation-3260000\sqlite3.c    220536   

You’re having trouble with Visual Studio, not with SQLite. A forum for VS users would be an appropriate place to ask for help.

—Jens
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


   
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Need setup code for VC++ 2017 that will ACTUALLY COMPILE

Larry Brasfield
Zydeholic wrote:
➢ I compile and get one error: Severity    Code    Description    Project    File    Line    Suppression State Error    LNK2001    unresolved external symbol _sqlite3_version    sqlite_try_3    C:\Users\DSNoS\source\repos\sqlite_try_3\sqlite_try_3\sqlite3.obj    1    

That symbol is declared, and a definition for the object so named is coded, in the sqlite3.c amalgamation without the possibility of omission by the preprocessor.  So I find it exceedingly strange that your link operation is complaining of an unresolvable reference to that symbol in sqlite3.obj.  For a C compilation, which you certainly should be using for that C source, the name should be undecorated, except for the leading underscore, just as it appears in the above-quoted error message.  This leads me to believe you are doing something too strange for anybody to guess with the information provided so far.

You may notice that this thread is misnamed for this latest difficulty, since the code does actually compile.  If I had to name it accurately, it would be called: [off topic] Need build instructions for my project which uses SQLite in a development environment differing from the one actually supported by the SQLite team.

Some questions to ask yourself as you attempt to sort this out:
1. Am I compiling the .c sources as C language?
2. Have I modified the sources everybody assumes are as released by the SQLite team?
3. What does insight does dumpbin.exe, (the VC command line tool for showing compiled image content), provide into my link errors?
4. How does my sqlite3.obj differ from the one I get following step 19 at https://www.sqlite.org/cli.html , and why?
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Need setup code for VC++ 2017 that will ACTUALLY COMPILE

Scott Doctor

Try creating a fresh project, call it sqliteshell.exe

The amalgamation zip has a file called shell.c

Add the files shell.c, sqlite3.c, and sqlite3.h to the new project

compile.

See if you still get any errors. The shell.c program is the
command line utility. See if you still get any errors.


-------------------------
Scott Doctor
[hidden email]
-------------------------

On 12/21/2018 13:02, Larry Brasfield wrote:

> Zydeholic wrote:
> ➢ I compile and get one error: Severity    Code    Description    Project    File    Line    Suppression State Error    LNK2001    unresolved external symbol _sqlite3_version    sqlite_try_3    C:\Users\DSNoS\source\repos\sqlite_try_3\sqlite_try_3\sqlite3.obj    1
>
> That symbol is declared, and a definition for the object so named is coded, in the sqlite3.c amalgamation without the possibility of omission by the preprocessor.  So I find it exceedingly strange that your link operation is complaining of an unresolvable reference to that symbol in sqlite3.obj.  For a C compilation, which you certainly should be using for that C source, the name should be undecorated, except for the leading underscore, just as it appears in the above-quoted error message.  This leads me to believe you are doing something too strange for anybody to guess with the information provided so far.
>
> You may notice that this thread is misnamed for this latest difficulty, since the code does actually compile.  If I had to name it accurately, it would be called: [off topic] Need build instructions for my project which uses SQLite in a development environment differing from the one actually supported by the SQLite team.
>
> Some questions to ask yourself as you attempt to sort this out:
> 1. Am I compiling the .c sources as C language?
> 2. Have I modified the sources everybody assumes are as released by the SQLite team?
> 3. What does insight does dumpbin.exe, (the VC command line tool for showing compiled image content), provide into my link errors?
> 4. How does my sqlite3.obj differ from the one I get following step 19 at https://www.sqlite.org/cli.html , and why?
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Need setup code for VC++ 2017 that will ACTUALLY COMPILE

zydeholic
In reply to this post by Larry Brasfield
Ok, to further define my goals, I am not looking to compile the files into a final EXE, unless that is the only way I can use it with my program.  I want to tap into the sqlite functionality from a C++ application I am writing. 

I suppose I need to use the DLL that I downloaded, but have never used an external library before, not where I had to tell the compiler how to talk to it.
So, SQLite, backend database.  I will do the front end stuff in my code.  Hopefully this clarifies something.


      From: Larry Brasfield <[hidden email]>
 To: "[hidden email]" <[hidden email]>
 Sent: Friday, December 21, 2018 1:02 PM
 Subject: Re: [sqlite] Need setup code for VC++ 2017 that will ACTUALLY COMPILE
   
Zydeholic wrote:
➢ I compile and get one error: Severity    Code    Description    Project    File    Line    Suppression State Error    LNK2001    unresolved external symbol _sqlite3_version    sqlite_try_3    C:\Users\DSNoS\source\repos\sqlite_try_3\sqlite_try_3\sqlite3.obj    1    

That symbol is declared, and a definition for the object so named is coded, in the sqlite3.c amalgamation without the possibility of omission by the preprocessor.  So I find it exceedingly strange that your link operation is complaining of an unresolvable reference to that symbol in sqlite3.obj.  For a C compilation, which you certainly should be using for that C source, the name should be undecorated, except for the leading underscore, just as it appears in the above-quoted error message.  This leads me to believe you are doing something too strange for anybody to guess with the information provided so far.

You may notice that this thread is misnamed for this latest difficulty, since the code does actually compile.  If I had to name it accurately, it would be called: [off topic] Need build instructions for my project which uses SQLite in a development environment differing from the one actually supported by the SQLite team.

Some questions to ask yourself as you attempt to sort this out:
1. Am I compiling the .c sources as C language?
2. Have I modified the sources everybody assumes are as released by the SQLite team?
3. What does insight does dumpbin.exe, (the VC command line tool for showing compiled image content), provide into my link errors?
4. How does my sqlite3.obj differ from the one I get following step 19 at https://www.sqlite.org/cli.html , and why?
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


   
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Need setup code for VC++ 2017 that will ACTUALLY COMPILE

Keith Medcalf

C++ is just C with mungified names and structures with pointers.  You can call C functions from C++.  You compile the "C" stuff as "C" and the "C++" stuff as "C++".  You then link them together to produce as executable.

In order to generate a "load module" output (ya know, that EXE thing that you run), you need to have something with a program called "main" (for narrow console applications) "wmain" (for wide console applications), or "WinMain" (for that oh so gooey feeling).  SQLite3.c/h do not contain any of these things as they are LIBRARIES OF CODE (aka functions) that YOUR APPLICATION calls, not the application itself.

shell.c is an "application" that contains a "main" that can be called from the runtime initializer thus outputting an runnable application (an EXE file).

---
The fact that there's a Highway to Hell but only a Stairway to Heaven says a lot about anticipated traffic volume.


>-----Original Message-----
>From: sqlite-users [mailto:sqlite-users-
>[hidden email]] On Behalf Of zydeholic
>Sent: Friday, 21 December, 2018 16:47
>To: SQLite mailing list
>Subject: Re: [sqlite] Need setup code for VC++ 2017 that will
>ACTUALLY COMPILE
>
>Ok, to further define my goals, I am not looking to compile the files
>into a final EXE, unless that is the only way I can use it with my
>program.  I want to tap into the sqlite functionality from a C++
>application I am writing.
>
>I suppose I need to use the DLL that I downloaded, but have never
>used an external library before, not where I had to tell the compiler
>how to talk to it.
>So, SQLite, backend database.  I will do the front end stuff in my
>code.  Hopefully this clarifies something.
>
>
>      From: Larry Brasfield <[hidden email]>
> To: "[hidden email]" <sqlite-
>[hidden email]>
> Sent: Friday, December 21, 2018 1:02 PM
> Subject: Re: [sqlite] Need setup code for VC++ 2017 that will
>ACTUALLY COMPILE
>
>Zydeholic wrote:
>➢ I compile and get one error:
>Severity    Code    Description    Project    File    Line    Suppres
>sion State Error    LNK2001    unresolved external symbol
>_sqlite3_version    sqlite_try_3    C:\Users\DSNoS\source\repos\sqlit
>e_try_3\sqlite_try_3\sqlite3.obj    1
>
>That symbol is declared, and a definition for the object so named is
>coded, in the sqlite3.c amalgamation without the possibility of
>omission by the preprocessor.  So I find it exceedingly strange that
>your link operation is complaining of an unresolvable reference to
>that symbol in sqlite3.obj.  For a C compilation, which you certainly
>should be using for that C source, the name should be undecorated,
>except for the leading underscore, just as it appears in the above-
>quoted error message.  This leads me to believe you are doing
>something too strange for anybody to guess with the information
>provided so far.
>
>You may notice that this thread is misnamed for this latest
>difficulty, since the code does actually compile.  If I had to name
>it accurately, it would be called: [off topic] Need build
>instructions for my project which uses SQLite in a development
>environment differing from the one actually supported by the SQLite
>team.
>
>Some questions to ask yourself as you attempt to sort this out:
>1. Am I compiling the .c sources as C language?
>2. Have I modified the sources everybody assumes are as released by
>the SQLite team?
>3. What does insight does dumpbin.exe, (the VC command line tool for
>showing compiled image content), provide into my link errors?
>4. How does my sqlite3.obj differ from the one I get following step
>19 at https://www.sqlite.org/cli.html , and why?
>_______________________________________________
>sqlite-users mailing list
>[hidden email]
>http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
>
>
>_______________________________________________
>sqlite-users mailing list
>[hidden email]
>http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users



_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Need setup code for VC++ 2017 that will ACTUALLY COMPILE

zydeholic
In reply to this post by zydeholic
My cpp code consists of this at the moment:
#include "sqlite3.h"
#include <fstream>
#include <iostream>
using namespace std;

int main()
{
    sqlite3 *db;
}

I have added sqlite3.h to my header files.I have added sqlite3.c to my source files.I've moved these two files, plus sqlite3.dll and sqlite3.lib into the same directory as these other files:
C:\users\dsnos\source\repos\sqlite_try_3\sqlite_try_3

In Project, I've made the following settings:VC++ Directories>>Library Directories>>C:\users\dsnos\source\repos\sqlite_try_3\sqlite_try_3;C/C++>>Additional Include Directories>>C:\users\dsnos\source\repos\sqlite_try_3\sqlite_try_3;
C/C++>>Precompiled Headers>>Not using precompiled headers (all configurations, all platforms).
Linker>>Input>>Additional Dependencies>>sqlite3.lib
I now get two errors when I compile:
Severity    Code    Description    Project    File    Line    Suppression State
Error    LNK2001    unresolved external symbol _sqlite3_version    sqlite_try_3    C:\Users\DSNoS\source\repos\sqlite_try_3\sqlite_try_3\sqlite3.obj    1    
Severity    Code    Description    Project    File    Line    Suppression State
Error    LNK1120    1 unresolved externals    sqlite_try_3    C:\Users\DSNoS\source\repos\sqlite_try_3\Debug\sqlite_try_3.exe    1   


At some point before I started filling in the directories and such in Project, my code:
sqlite3 *db;
was errored out (underlined in red).  Now they are not erroring out.  I just get the two errors above when I compile.

      From: zydeholic <[hidden email]>
 To: SQLite mailing list <[hidden email]>
 Sent: Friday, December 21, 2018 3:46 PM
 Subject: Re: [sqlite] Need setup code for VC++ 2017 that will ACTUALLY COMPILE
   
Ok, to further define my goals, I am not looking to compile the files into a final EXE, unless that is the only way I can use it with my program.  I want to tap into the sqlite functionality from a C++ application I am writing. 

I suppose I need to use the DLL that I downloaded, but have never used an external library before, not where I had to tell the compiler how to talk to it.
So, SQLite, backend database.  I will do the front end stuff in my code.  Hopefully this clarifies something.


      From: Larry Brasfield <[hidden email]>
 To: "[hidden email]" <[hidden email]>
 Sent: Friday, December 21, 2018 1:02 PM
 Subject: Re: [sqlite] Need setup code for VC++ 2017 that will ACTUALLY COMPILE
 
Zydeholic wrote:
➢ I compile and get one error: Severity    Code    Description    Project    File    Line    Suppression State Error    LNK2001    unresolved external symbol _sqlite3_version    sqlite_try_3    C:\Users\DSNoS\source\repos\sqlite_try_3\sqlite_try_3\sqlite3.obj    1    

That symbol is declared, and a definition for the object so named is coded, in the sqlite3.c amalgamation without the possibility of omission by the preprocessor.  So I find it exceedingly strange that your link operation is complaining of an unresolvable reference to that symbol in sqlite3.obj.  For a C compilation, which you certainly should be using for that C source, the name should be undecorated, except for the leading underscore, just as it appears in the above-quoted error message.  This leads me to believe you are doing something too strange for anybody to guess with the information provided so far.

You may notice that this thread is misnamed for this latest difficulty, since the code does actually compile.  If I had to name it accurately, it would be called: [off topic] Need build instructions for my project which uses SQLite in a development environment differing from the one actually supported by the SQLite team.

Some questions to ask yourself as you attempt to sort this out:
1. Am I compiling the .c sources as C language?
2. Have I modified the sources everybody assumes are as released by the SQLite team?
3. What does insight does dumpbin.exe, (the VC command line tool for showing compiled image content), provide into my link errors?
4. How does my sqlite3.obj differ from the one I get following step 19 at https://www.sqlite.org/cli.html , and why?
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


   

   
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Need setup code for VC++ 2017 that will ACTUALLY COMPILE

Igor Korot
Hi,

On Fri, Dec 21, 2018 at 6:26 PM zydeholic <[hidden email]> wrote:

>
> My cpp code consists of this at the moment:
> #include "sqlite3.h"
> #include <fstream>
> #include <iostream>
> using namespace std;
>
> int main()
> {
>     sqlite3 *db;
> }
>
> I have added sqlite3.h to my header files.I have added sqlite3.c to my source files.I've moved these two files, plus sqlite3.dll and sqlite3.lib into the same directory as these other files:
> C:\users\dsnos\source\repos\sqlite_try_3\sqlite_try_3
>
> In Project, I've made the following settings:VC++ Directories>>Library Directories>>C:\users\dsnos\source\repos\sqlite_try_3\sqlite_try_3;C/C++>>Additional Include Directories>>C:\users\dsnos\source\repos\sqlite_try_3\sqlite_try_3;
> C/C++>>Precompiled Headers>>Not using precompiled headers (all configurations, all platforms).
> Linker>>Input>>Additional Dependencies>>sqlite3.lib

You are almost there.
Just like you added the "Include Directory", you now need to add
"Linker Directory" or "Library Directory"

Thank you.



> I now get two errors when I compile:
> Severity    Code    Description    Project    File    Line    Suppression State
> Error    LNK2001    unresolved external symbol _sqlite3_version    sqlite_try_3    C:\Users\DSNoS\source\repos\sqlite_try_3\sqlite_try_3\sqlite3.obj    1
> Severity    Code    Description    Project    File    Line    Suppression State
> Error    LNK1120    1 unresolved externals    sqlite_try_3    C:\Users\DSNoS\source\repos\sqlite_try_3\Debug\sqlite_try_3.exe    1
>
>
> At some point before I started filling in the directories and such in Project, my code:
> sqlite3 *db;
> was errored out (underlined in red).  Now they are not erroring out.  I just get the two errors above when I compile.
>
>       From: zydeholic <[hidden email]>
>  To: SQLite mailing list <[hidden email]>
>  Sent: Friday, December 21, 2018 3:46 PM
>  Subject: Re: [sqlite] Need setup code for VC++ 2017 that will ACTUALLY COMPILE
>
> Ok, to further define my goals, I am not looking to compile the files into a final EXE, unless that is the only way I can use it with my program.  I want to tap into the sqlite functionality from a C++ application I am writing.
>
> I suppose I need to use the DLL that I downloaded, but have never used an external library before, not where I had to tell the compiler how to talk to it.
> So, SQLite, backend database.  I will do the front end stuff in my code.  Hopefully this clarifies something.
>
>
>       From: Larry Brasfield <[hidden email]>
>  To: "[hidden email]" <[hidden email]>
>  Sent: Friday, December 21, 2018 1:02 PM
>  Subject: Re: [sqlite] Need setup code for VC++ 2017 that will ACTUALLY COMPILE
>
> Zydeholic wrote:
> ➢ I compile and get one error: Severity    Code    Description    Project    File    Line    Suppression State Error    LNK2001    unresolved external symbol _sqlite3_version    sqlite_try_3    C:\Users\DSNoS\source\repos\sqlite_try_3\sqlite_try_3\sqlite3.obj    1
>
> That symbol is declared, and a definition for the object so named is coded, in the sqlite3.c amalgamation without the possibility of omission by the preprocessor.  So I find it exceedingly strange that your link operation is complaining of an unresolvable reference to that symbol in sqlite3.obj.  For a C compilation, which you certainly should be using for that C source, the name should be undecorated, except for the leading underscore, just as it appears in the above-quoted error message.  This leads me to believe you are doing something too strange for anybody to guess with the information provided so far.
>
> You may notice that this thread is misnamed for this latest difficulty, since the code does actually compile.  If I had to name it accurately, it would be called: [off topic] Need build instructions for my project which uses SQLite in a development environment differing from the one actually supported by the SQLite team.
>
> Some questions to ask yourself as you attempt to sort this out:
> 1. Am I compiling the .c sources as C language?
> 2. Have I modified the sources everybody assumes are as released by the SQLite team?
> 3. What does insight does dumpbin.exe, (the VC command line tool for showing compiled image content), provide into my link errors?
> 4. How does my sqlite3.obj differ from the one I get following step 19 at https://www.sqlite.org/cli.html , and why?
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
>
>
>
>
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
12