Visual Studio 2022 Database with SQLite

Juergen Babenhauserheide 0 Reputation points
2023-10-23T11:53:43.7666667+00:00

Hello,

I have a question about Visual Studio 2022 database with SQLite.

A few years ago (2017) I created a program with the "SQLite" database using Visual Studio 2015.

I can still start the program created with Visual Studio 2015 today. But when I call the old project with Visual Studio 2022 I get some error messages.

E1696 Cannot open source file: "stdio.h", "stdlib.h", "iosteam.h", "sqlite3.h".


Can I no longer use "SQLite" in the 2022 version and must use it as described in Create a database and add tables in Visual Studio?

https://learn.microsoft.com/de-de/visualstudio/data-tools/create-a-sql-database-by-using-a-designer?view=vs-2022#prerequisites

I installed SQLite on my WINDOWS 11 PC: SQLite - Installation

https://www.tutorialspoint.com/sqlite/sqlite_installation.htm

Unfortunately, my 2017 documentation for Visual Studio 2015 with SQLite is incomplete and the links shown are no longer valid: SQLite2.jpg, SQLite3.jpg, SQLite4.jpg

[http://sqlitebot.googlecode.com/files/sqlite2.jpg]

[http://sqlitebot.googlecode.com/files/sqlite3.jpg]

[http://sqlitebot.googlecode.com/files/sqlite4.jpg]

Kind Regards

Juergen

Developer technologies Visual Studio Other
{count} votes

3 answers

Sort by: Most helpful
  1. Tianyu Sun-MSFT 34,436 Reputation points Microsoft External Staff
    2023-10-25T07:05:44.3366667+00:00

    Hi @Juergen Babenhauserheide ,

    Thanks for sharing us the code and the screenshot.

    Did you try to retarget your project(right-click your project > Retarget Projects) and select the corresponding Windows SDK Version and Platform Toolset(right-click your project > Properties > Configuration Properties > General > Windows SDK Version, Platform Toolset)? If the corresponding version of Windows SDK is missing, you can install it from VS Installer > Modify > Individual components > SDKs, libraries, and frameworks.

    If you have set the correct Windows SDK Version and Platform Toolset, then please try to close VS, delete the hidden .vs folder in your solution folder and rebuild your project.

    Kind Regards,

    Tianyu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. Juergen Babenhauserheide 0 Reputation points
    2023-10-26T11:09:10.8233333+00:00

    Hello,

    thank you for your information.

    Deleting the .vs folder has already helped.

    I can compile the program code without any error messages.

    But when I create the program I get the following messages (for all SQLite functions):

    LNK2019: Reference to unresolved external symbol 'sqlite3_close' in function 'main'.

    I.e. the linker doesn't find the SQLite.lib or does it?

    Where exactly does the LIB have to be located?

    At the moment I have the “sqlite3.*” in the project directory:

    SQLite_02\SQLite_02\sqlite3.h, sqlite3.c, sqlite3.lib, sqlite3.dll // is the source code directory SQLite_02\SQLite_02\include\sqlite3.c, sqlite3.h

    SQLite_02\SQLite_02\lib\sqlite3.lib

    Kind Regards

    Juergen

    
    
    0 comments No comments

  3. Juergen Babenhauserheide 0 Reputation points
    2023-10-26T12:42:52.6966667+00:00

    Hello,

    I have solved my Problem:

    1. delete the project-folder ".vs"
    2. insert the file "sqlite3.lib" in: Projectmapp-Explorer -> Ressourcenfiles.

    So I can create my old progam "sqlite_02" from the year 2017 (VS2015).

    Good thing I asked.

    Kind Regards

    Juergen


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.