C++/CLI Array problem
-
I'm using the new Visual C++ Express beta and when I try to compile a file containing this code: int fileLength = binRead->ToString()->Length; array^ sendFile = gcnew array(fileLength); I get the following errors: error C2065: 'array' : undeclared identifier error C2275: 'System::Byte' : illegal use of this type as an expression stdafx.cpp : see declaration of 'System::Byte' error C2065: 'sendFile' : undeclared identifier error C3192: syntax error : '^' is not a prefix operator (did you mean '*'?) error C2061: syntax error : identifier 'array' From several articles i've read it seemed to me as though I was declaring the array in the proper manner, however can anyone give me a hand with this? Could the error possibly be elsewhere in my code? [Edit]I know when declaring native arrays the length must be a constant, is that also the case with C++/CLI Arrays?
-
I'm using the new Visual C++ Express beta and when I try to compile a file containing this code: int fileLength = binRead->ToString()->Length; array^ sendFile = gcnew array(fileLength); I get the following errors: error C2065: 'array' : undeclared identifier error C2275: 'System::Byte' : illegal use of this type as an expression stdafx.cpp : see declaration of 'System::Byte' error C2065: 'sendFile' : undeclared identifier error C3192: syntax error : '^' is not a prefix operator (did you mean '*'?) error C2061: syntax error : identifier 'array' From several articles i've read it seemed to me as though I was declaring the array in the proper manner, however can anyone give me a hand with this? Could the error possibly be elsewhere in my code? [Edit]I know when declaring native arrays the length must be a constant, is that also the case with C++/CLI Arrays?
BrianOlej wrote: error C3192: syntax error : '^' is not a prefix operator (did you mean '*'?) If the compiler does not recognize that operator it might indicate that you do not of the project configured properly for managed extensions.
"No matter where you go, there your are." - Buckaroo Banzai
-pete
-
BrianOlej wrote: error C3192: syntax error : '^' is not a prefix operator (did you mean '*'?) If the compiler does not recognize that operator it might indicate that you do not of the project configured properly for managed extensions.
"No matter where you go, there your are." - Buckaroo Banzai
-pete
I would have to have rethought my entire life if that was the problem. Naw, when I comment out the arrays the rest of the managed code compiles fine. Signature under construction.
-
I would have to have rethought my entire life if that was the problem. Naw, when I comment out the arrays the rest of the managed code compiles fine. Signature under construction.
-
I'm using the new Visual C++ Express beta and when I try to compile a file containing this code: int fileLength = binRead->ToString()->Length; array^ sendFile = gcnew array(fileLength); I get the following errors: error C2065: 'array' : undeclared identifier error C2275: 'System::Byte' : illegal use of this type as an expression stdafx.cpp : see declaration of 'System::Byte' error C2065: 'sendFile' : undeclared identifier error C3192: syntax error : '^' is not a prefix operator (did you mean '*'?) error C2061: syntax error : identifier 'array' From several articles i've read it seemed to me as though I was declaring the array in the proper manner, however can anyone give me a hand with this? Could the error possibly be elsewhere in my code? [Edit]I know when declaring native arrays the length must be a constant, is that also the case with C++/CLI Arrays?
-
Perfect! Thank you, it solved my problem. Signature under construction.
-
Perfect! Thank you, it solved my problem. Signature under construction.
-
Interesting..I thought that was automatically imported for every /clr build. Maybe not in beta 1, I guess. Matt
Yeah, I thought so as well, I guess not. Signature under construction.
-
Interesting..I thought that was automatically imported for every /clr build. Maybe not in beta 1, I guess. Matt