I want to do database coding in c++. What modern C++ libraries should be in my toolbox? shows that SOCI is a good library which is cross-platform and free. But the installation of SOCI is a big issue, since I can't find a good blog or tutorial or article or anything giving a detailed rundown. I followed the instructions on the SOCI official page http://soci.sourceforge.net/doc/3.2/installation.html but after succesfully (kinda since it doesn't detect boost. so I had to run it without boost) running cmake, when I build the .sln in visual studio, it gives me 4 errors. I tried everything for days, but nothing seems to work. There is just one video on yt https://www.youtube.com/watch?v=gFGLKaDnwmI, but it shows a method were you have to manipulate the micros in the lib files. I don't want to do that. And since I thought it was a reputed and popular lib, I wouldn't have to to that. Anyways, the build o/p is too large, so I have posted the errors that I get. The first one appears three times. So, that why I think I am getting the 4 failed in the final result.
5>C:\Program Files (x86)\Windows Kits\10\Include\10.0.17134.0\ucrt\stdio.h(1935): fatal error C1189: #error: Macro definition of snprintf conflicts with Standard Library function declaration 8>LINK : fatal error LNK1104: cannot open file '..\..\..\lib\Debug\libsoci_postgresql_3_2.lib' ========== Build: 8 succeeded, 4 failed, 0 up-to-date, 3 skipped ==========
I have another question which is not important but just as an fyi (don't flag me for this. If you want I'll delete it). Is database programming not done in c++ that often? or if done do c++ coders prefer the C apis more than c++ ones? Cos, I have had real trouble finding good recent articles or blog on the same.