LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-23-2002, 04:32 AM   #1
Rex_chaos
Member
 
Registered: Aug 2001
Location: GD, GZ, China
Posts: 240

Rep: Reputation: 30
g++ problem under linux


Hi,
Does anyone try compiling the following code with g++ in linux?

valarray<double> *v=new valarray<double>(16);
static_cast<valarray<double> >((*v)[slice(4,4,1)]) += 4.0;

Unfortunately, compile error!!!!!!!!!!!!!!!!!!!!!!!!!

Please help, thanks in advance!
 
Old 07-23-2002, 07:11 AM   #2
Mik
Senior Member
 
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 47
It doesn't give me any compile errors. Make sure you add the following two lines in your code:

#include <valarray>
using namespace std;
 
Old 07-23-2002, 07:19 AM   #3
Rex_chaos
Member
 
Registered: Aug 2001
Location: GD, GZ, China
Posts: 240

Original Poster
Rep: Reputation: 30
Are u using g++? What version?

Thanks.
 
Old 07-23-2002, 07:30 AM   #4
Mik
Senior Member
 
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 47
#g++ -v
Reading specs from /usr/lib/gcc-lib/i486-suse-linux/2.95.3/specs
gcc version 2.95.3 20010315 (SuSE)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Sound Card problem(every time i install linux i have diffirent hardware problem) jacka1l Linux - Newbie 7 08-11-2005 06:10 AM
Linux=Chaos... Someone needs to fix the Linux problem Skrilla Linux - Distributions 127 07-29-2005 09:11 PM
linux from scratch build with linux-2.6.11 and my pktsetup problem! behmjoe Linux - Software 8 04-02-2005 03:32 AM
Cups Printing problem, Linux to Linux Printing problem folken718 Slackware 2 11-08-2004 10:10 AM
Redhat (rhel v2.1) bootup problem with linux (linux vs linux-up) namgor Linux - Software 2 06-24-2004 02:49 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration