Answer the question
In order to leave comments, you need to log in
Problems compiling in visual studio 2015 after adapting with visual studio 2010. What should I do?
The project was written in visual studio 2010. I translated it into visual studio 2015, but problems started to arise. I got rid of almost all of them, but the problem with std::array remained.
The Form1.h file, as I understand it, is a file for the form designer.
Example::top_cornea = gcnew array<int>(bmp->Width);
Example::bottom_cornea = gcnew array<int>(bmp->Width);
Example::x1_width= gcnew array<int>(bmp->Width);
Example::x2_width= gcnew array<int>(bmp->Width);
Example::width_cornea= gcnew array<int>(bmp->Width);
Example::top_cornea = gcnew array<int, (bmp->Width)>;
Example::bottom_cornea = gcnew array<int, (bmp->Width)>;
Example::x1_width= gcnew array<int, (bmp->Width)>;
Example::x2_width= gcnew array<int, (bmp->Width)>;
Example::width_cornea= gcnew array<int, (bmp->Width)>;
Answer the question
In order to leave comments, you need to log in
Looks like using namespace std was added somewhere, causing array to be recognized as std::array instead of cli::array
Either remove using namespace std or explicitly specify cli wherever needed:
gcnew cli::array(...
std::array is created on the stack as a regular sish array and requires the size to be specified at compile time, something like this: std::array<int, 3> array = {1, 2, 3};
Edit: Perhaps something else is needed there, but somewhere using namespace std
Edit is used: Didn't get into the second part right away. The template parameter must be known at compile time, i.e. bmp->Width must be constexpr or statc constexpr with the appropriate referencing syntax. Dynamic arrays in C++ are std::vector, you most likely used array from CLI, but I don't understand CLI.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question