taocpp / taopq

C++ client library for PostgreSQL
Boost Software License 1.0
265 stars 40 forks source link

I have some problems to compile and use the incomplete methods #5

Closed pragmata closed 5 years ago

pragmata commented 6 years ago

First of all, greetings and thanks for your excellent work.

I have some drawbacks when using the methods declared in each class.

For example, this error appears in null.hpp "Error 1 error C2470: 'final': looks like a function definition, but there is no parameter list; skipping apparent body", I do not have much expertise in the language so I do not understand the reason.

Also in the file "integer_sequence.hpp", in the line of code: template <typename T, T ... Ns> These three points after the T, what do they mean and how can I adapt the methods in each file? I would really appreciate your help

d-frey commented 6 years ago

The errors you are seeing are probably due to the compiler and version of the compiler you are using. You seem to use Visual Studio, which I currently haven't tested. Also, older versions won't be able to compile any of the code.

The final is an example of a C++11 feature we are using, if your compiler doesn't support it, it seems to be fairly old. The same goes for the support of variadic templates (the ellipsis, the three dots you were wondering about). You won't be able to "adapt" the methods, you first need to find a reasonably modern compiler.

If I find some time, I will try and work on support for Visual Studio 2017 or even 2015 at the weekend.

pragmata commented 6 years ago

Oh, wow! Now I understand why the IDE does not recognize part of the syntax of the code. I am using VS2008 because I am migrating the connection logic and the business rules they use as DB SQLite.

What IDE would you recommend me to be able to exclusively use your code?

regards

d-frey commented 6 years ago

Just a quick update:

I started to work on this last weekend, adding CMake-support, then using AppVeyor to build the code with CMake and Visual Studio. After that it was mostly fixing warnings and incompatibilities between Visual Studio, GCC and Clang. It's still an on-going process, but I'm making some progress.

I managed to get the library and the test code to compile cleanly on Visual Studio 2017 in 64 bit mode. Some testcases are passing, some are not. If you have Visual Studio 2017, you could give it a go and try it for yourself.

Visual Studio 2015 seems to have a bug which I haven't found a work-around for, 32 bit is currently not supported and there are a few other issues. I'll probably keep working on it for a while, but for now you should not count on support for Visual Studio 2015 or earlier.

pragmata commented 6 years ago

very well, i'm gonna check it on VS2017 and try to run a simple project. Thanks for the help,I will be aware of any update you have available.

Regards