This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
RE: Problem with code or gcc?
- From: Ryan Mansfield <RMansfield at qnx dot com>
- To: "Kedzierski, Artur CIV NAVSURFWARCENDIV CORONA" <artur dot kedzierski at navy dot mil>, gcc-help at gcc dot gnu dot org
- Date: Tue, 27 Sep 2005 10:11:52 -0400
- Subject: RE: Problem with code or gcc?
http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.11
Regards,
Ryan Mansfield
-----Original Message-----
From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On
Behalf Of Kedzierski, Artur CIV NAVSURFWARCENDIV CORONA
Sent: Tuesday, September 27, 2005 9:40 AM
To: gcc-help@gcc.gnu.org
Subject: Problem with code or gcc?
Could anybody tell me if this is a valid C++ code or
a problem with GCC?
test_prog.cc:
#include <vector>
struct MyStruct {
static const int CONST = 1;
};
int main() {
std::vector<int> l;
MyStruct z;
l.push_back(z.CONST);
}
I get an undefined reference to MyStruct::CONST when
I try to compile it.
I appreciate any help.
Artur Kedzierski