Open gmueckl opened 4 years ago
#include <vector>
has never worked, and is in fact one of dpp's holy grails. C++14 has nothing to do with it, I've been using C++17 the whole time.
The specific error message I quoted can only appear in C++14 and above because the function signature of emplace_back changes. There's an #ifdef on the C++ version in the header (one of many, actually). In C++11 and older, the return type is simply void.
The root issue is that dpp doesn't find the right scope for a successful name lookup, but I can't figure out how the lookup algorithm goes wrong.
While trying to access Azure Storage API (C++) I receive and error:
Could not find namespaceless 'vector::iterator' in type 'storage_type::iterator'
Is this also related to the issue #include <vector>
is not working?
FROM dlang2/ldc-ubuntu:1.19.0 as ldc
RUN apt-get install -y unzip libxml2-dev uuid-dev build-essential cmake libboost-atomic-dev libboost-thread-dev libboost-system-dev libboost-date-time-dev libboost-regex-dev libboost-filesystem-dev libboost-random-dev libboost-chrono-dev libboost-serialization-dev libwebsocketpp-dev g++-5 gcc-5
RUN curl -L -o cpprestsdk.zip https://github.com/microsoft/cpprestsdk/archive/v2.10.14.zip \
&& unzip cpprestsdk.zip -d / \
&& ls /cpprestsdk-2.10.14
RUN apt-get install -y ninja-build
RUN cd /cpprestsdk-2.10.14 \
&& mkdir build.release \
&& cd build.release \
&& cmake -G Ninja .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/opt/cpprest-2.10.14 \
&& ninja
RUN apt-get install -y libboost-all-dev
RUN curl -L -o azure_storage_cpp.zip https://github.com/Azure/azure-storage-cpp/archive/v7.1.0.zip \
&& unzip azure_storage_cpp.zip -d / \
&& ls /azure-storage-cpp-7.1.0
RUN ls /cpprestsdk-2.10.14/build.release/Release/Binaries
RUN cd /azure-storage-cpp-7.1.0/Microsoft.WindowsAzure.Storage \
&& mkdir build.release \
&& cd build.release \
&& CXX=g++-5 cmake .. -DCMAKE_BUILD_TYPE=Release -DCASABLANCA_LIBRARY=/cpprestsdk-2.10.14/build.release/Release/Binaries -DCASABLANCA_INCLUDE_DIR=/cpprestsdk-2.10.14/Release/include \
&& make
RUN apt-get install -y clang-9 libclang-9-dev
RUN ln -s /usr/bin/clang-9 /usr/bin/clang
COPY was.dpp /tmp/
RUN DFLAGS="-L=-L/usr/lib/llvm-9/lib/" dub run dpp -- /tmp/was.dpp \
--include-path /cpprestsdk-2.10.14/Release/include \
--include-path /azure-storage-cpp-7.1.0/Microsoft.WindowsAzure.Storage/includes \
--include-path /usr/include/c++/7.4.0 \
--preprocess-only \
--parse-as-cpp
File was.dpp
#include <was/auth.h>
#include <was/blob.h>
To reproduce, try to preprocess
#include <vector>
The result is this error:
I suppose that the culprit is the return type of std::vector::emplace_back which changes from void to std::vector::reference with C++14 or higher.