New course! Every coder should learn Generative AI!
Try a free lesson+ 2
Did you look at these?
https://www.youtube.com/watch?v=eVueFhdVuME
https://www.sqlnethub.com/blog/how-to-connect-to-sql-server-from-visual-c-plus-plus/
It'll be much easier to connect c++ to Microsoft SQL Server if you're using Microsoft Visual c++ or Microsoft Visual Studio. Unless you're much better than I am at using third party libraries in c++, Microsoft's nuget manager will make it much easier than if you use non-Microsoft development tools. Microsoft also created Visual Studio, SQL Server, and its main c++ compiler so they would have supported developers doing exactly what you're doing until it became a smooth process.