open-dis / open-dis-cpp

C++ implementation of the IEEE-1278.1 Distributed Interactive Simulation (DIS) application protocol v6 and v7
BSD 2-Clause "Simplified" License
90 stars 65 forks source link

passing std::vector<ArticulatedPart> by ref in EntityStatePdu setter function. #70

Closed shadow88s closed 2 years ago

shadow88s commented 2 years ago

I'm having trouble passing a std::vector from a QT project to the setter function by reference. compiling the projects with C++14 and MSVC 2019 Debug mode.

These are the functions I'm trying to use from the EntityStatePdu class: std::vector& getArticulationParameters(); const std::vector& getArticulationParameters() const; void setArticulationParameters(const std::vector& pX);

When I pass a std::vector variable from QT, it seems to have a different binary layout on MSVC. Could it possibly be a compiler option that I have to match with OpenDIS in order to pass the same std::vector?

rodneyp290 commented 2 years ago

If your using a different compiler in your Qt project, there may be a possibility is in compatible :shrug: Assuming you're using Qt Creator for the Qt project, you should also be able to use the CMake to compile OpenDIS in Qt Creator, thus using the same compiler.

However, it's a bit unclear what issue your describing without any error message, or code context.

shadow88s commented 2 years ago

@rodneyp290 . Thank you! User Error, I was trying to use premake5 instead of CMake to configure/generate the make file and build/complie the MSVC Solution file. Using CMake with the debug, x64 configuration matching my project fixed it.