Re: trouble with valarray and gcc 3.3
Re: trouble with valarray and gcc 3.3
- Subject: Re: trouble with valarray and gcc 3.3
- From: Doug McCoy <email@hidden>
- Date: Thu, 9 Sep 2004 20:33:40 -0700 (PDT)
On Sep 9, 2004, at 9:58 PM, Joseph Kim wrote:
>>All other lines are fine as global variable declarations/initializations.
>>The offending line doesn't belong at this scope.
>>
>>I.e.:
>>
>>#include <valarray>
>>
>>
>>int main()
>>{
>> // ... insert your code here.
>> // ... the offending line is fine as a statement within a function.
>>
>>
>> return 0;
>>}
>>
>>Not an issue with Darwin GCC.
>>
>>As an aside, I always use "c++" rather than "gcc" to drive the linker to make
>>sure all the correct libraries and object files are brought in if at least
>>one of the source files is a C++ source file (too lazy to try to supply all the
>>right linker input manually :)
thanks for the quick reply. my bad on that. but the problem still exists.
----code----
#include <valarray>
int main{
std::valarray<int> v1; // construct an empty valarray
std::valarray<int> v2(1,3); // construct a valarray of three
// elements, all initialized to 1
v1.resize(3,2); // resize the first valarray to three
// elements, all initialized to 2
std::valarray<int> v3(v1); // v3 gets a copy of v1's elements.
}
---end---
and
---errors---
test.cpp:2: error: syntax error before `{' token
test.cpp:6: error: syntax error before `.' token
test.cpp:8: error: `v1' was not declared in this scope
test.cpp:9: error: parse error before `}' token
---end---
still having trouble.
???
__________________________________
Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!
http://promotions.yahoo.com/new_mail
_______________________________________________
darwin-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-development
Do not post admin requests to the list. They will be ignored.