jtv / libpqxx

The official C++ client API for PostgreSQL.
http://pqxx.org/libpqxx/
BSD 3-Clause "New" or "Revised" License
1.02k stars 240 forks source link

I met something bad after generating solutions after generated the source code by cmake #897

Closed LunaticLegacy closed 4 days ago

LunaticLegacy commented 4 days ago

image Fig.1 | A lot of vars and funcs were not the member of pqxx::result

image Fig.2 | The last time I used cmake

image Fig.3 | The latest progress of generating a solution by VS

Ah I really dunno how to deal with this. I linked all the files related to the source code and most the libs as I can, but I still failed to build the file. p.s. I'm a green hand to cmake and still learning how to use them. p.p.s. Maybe, I think maybe, somebody can read Chinese GUI by the places of buttons.

LunaticLegacy commented 4 days ago

[Uploading errors.txt…]()

tt4g commented 4 days ago

You say “using CMake”, but Figure2 shows that you are using vcpkg with -DCMAKE_TOOLCHAIN_FILE=D:/git/vcpkg/vcpkg-master/scripts/buildsystems/vpkg.cmake: https://learn.microsoft.com/en-us/vcpkg/users/buildsystems/cmake-integration Are you saying you installed libpqxx with vcpkg? If you are using vcpkg, ask your question in microsoft/vcpkg repository. If not, you should not specify -DCMAKE_TOOLCHAIN_FILE=D:/git/vcpkg/vcpkg-master/scripts/buildsystems/vpkg.cmake should not be specified.

And target_link_libraries(runner PUBLIC pqxx) should fail because CMakeLists.txt is missing find_package(libpqxx). I do not know why the error does not occur.

LunaticLegacy commented 4 days ago

Solved, thx. Then I met another issue: image Fig.4 | Cannot generate IntelliSense PCH Because of headerstop location is not in my file

You say “using CMake”, but Figure2 shows that you are using vcpkg with -DCMAKE_TOOLCHAIN_FILE=D:/git/vcpkg/vcpkg-master/scripts/buildsystems/vpkg.cmake: https://learn.microsoft.com/en-us/vcpkg/users/buildsystems/cmake-integration Are you saying you installed libpqxx with vcpkg? If you are using vcpkg, ask your question in microsoft/vcpkg repository. If not, you should not specify -DCMAKE_TOOLCHAIN_FILE=D:/git/vcpkg/vcpkg-master/scripts/buildsystems/vpkg.cmake should not be specified.

And target_link_libraries(runner PUBLIC pqxx) should fail because CMakeLists.txt is missing find_package(libpqxx). I do not know why the error does not occur.