Visual Studio c++ no symbols loaded for dll after moving dll into proper code path

161 views Asked by At

I am trying to create a simple application in Visual Studio 2019 that connects to SQL Server. I am using the sqlapi++ library to create the connection. I am trying to gain more experience with c++ and 3rd party libraries. My experience in c++ has mostly been on a macbook with xcode and standard c++ libraries.

I get the following error:

then I get this error:

No symbol loaded for sqlapi.dll

binary was not built in with debug information.

It specifies the file location as C:\Users\name\source\repos\ProjectName\Debug\sqlapi.dll. I look in this file location and it is there. Which is also where the exe file gets generated. My code so far is very simple:

#include <SQLAPI.h>
#include <iostream>

int main()
{
    SAConnection con;
    SACommand cmd(&con);

    try
    {
        con.Connect(
            "Database@ServerName",
            "Username",
            "Password",
            "SA_SQLServer_Client);
        cmd.setCommandText("SELECT * FROM dbo.TableName");
        cmd.Execute();
    }
    catch (int exception)
    {
    
    }
}

I set a breakpoint on con.Connect() and continue, then it loads symbols for a few seconds before giving me an error. My question is, how can I ensure that my .dll files get loaded in Visual Studio properly? Should my .dll and .pdb files all be moved to the file location that the .exe files gets generated in? Or just put them in the same file as the .cpp file?

0

There are 0 answers