vector
Norman Vine
nhv@cape.com
Thu Aug 22 08:27:00 GMT 2002
Dan Mergens writes:
>
>I'm baffled why this simple program produces the following errors.
>Strangly enough, if I remove the push_back call, it compiles without
>complaint.
>
>I'm running the latest version of cygwin. I'm sure I'm missing
>something...
>
>Thanks,
>Dan
>
>-------------- test.C ------------------
>#include <vector>
>void main() {
>vector<int> array;
>array.push_back(10);
>}
>----------------------------------------
This is really OT for this list but since there have been several
similar posts recently
< please use a general C++ programming list >
try
// compile with g++ < or c++ >
// c++ test.C
// if compiling with gcc libstdc++ must be linked explicitly
// gcc test.C -lstdc++
#include <vector>
int main(void) {
std::vector<int> array;
array.push_back(10);
return 0;
}
note that main() MUST be declared to return an int
and that vector<> MUST be qualified
Norman
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
More information about the Cygwin
mailing list