how to complex.h in C on SUN


 
Thread Tools Search this Thread
Operating Systems Solaris how to complex.h in C on SUN
# 1  
Old 09-22-2008
how to complex.h in C on SUN

Hi,
The C code we've written work ok on Mac, but make a " segmentation fault" when running on SUN. One potential bug is complex.h because the complex.h in the lib/ is licensed by Apple. Does anybody know how to add in complex.h into lib/ on the SUN so we can deal with complex numbers in our code?

Thx.
# 2  
Old 09-22-2008
Complex.h in C programming on SUN

Hi,
The C code we've written work ok on Mac, but make a " segmentation fault" when running on SUN. One potential bug is complex.h because the complex.h in the lib/ is licensed by Apple. Does anybody know how to add in complex.h into lib/ on the SUN so we can deal with complex numbers in our code?

Thx.
# 3  
Old 09-22-2008
Can you get the gcc compiler and runtime library? That is one way. complex.h is part of the C99 standard. So modern versions of gcc provide it.
# 4  
Old 09-22-2008
question on allocate memory

Thx.
I debugged the code a bit. And Seems the complex.h is used inherently in the gcc compiler on SUN and this is not the bug.

Another potential one is on allocating memory for a struct ALOS_ORB, which contain another struct. Can anyone tell me how to allocate this by malloc ?
What I did is orb = malloc(sizeof(struct ALOS_ORB));
and I've no idea how to contain another one.


struct ALOS_ORB {
int itype;
int nd;
int iy;
int id;
double sec;
double dsec;
struct ORB_XYZ *points;
};

struct ORB_XYZ {
double pt;
double px;
double py;
double pz;
double vx;
double vy;
double vz;
};
Login or Register to Ask a Question

Previous Thread | Next Thread

4 More Discussions You Might Find Interesting

1. Solaris

Application running too slow on Sun SPARC T5440 but run normal on sun M3000

Hi all, I have application running on sun server T5440 4x8x1.4 GHz, 64 GB RAM, application running very slow though load average too low. when I install my application on another server SUN M3000 (One CPU 1x8x2.5GHz, 8GB RAM), application run smoothly. Here is my server T5440 info: ... (6 Replies)
Discussion started by: insatiable1610
6 Replies

2. Solaris

Sun Fire 280R Sun Solaris CRT/Monitor requirements

I am new to Sun. I brought Sun Fire 280R to practice UNIX. What are the requirements for the monitor/CRT? Will it burn out old non-Sun CRTs? Does it need LCD monitor? Thanks. (3 Replies)
Discussion started by: bramptonmt
3 Replies

3. UNIX for Dummies Questions & Answers

Sun Solaris 10: How do I create a bootup disc? The Sun website confuses me

Hey there, I am starting a Computer Science Foundation year at the end of this month and am trying to get a little bit ahead of the game. I have always wanted to learn Unix and am currently struggling with creating a boot disc to run Solaris (I have chosen to study this) from as opposed to... (0 Replies)
Discussion started by: Jupiter
0 Replies

4. UNIX for Advanced & Expert Users

Help: Sun Disk partitioning for Sun V240 & StorEdge 3300

Dear Sun gurus, I have Sun Fire V240 server with its StorEdge 3300 disk-array. Following are its disks appeared in format command. I have prepared its partitions thru format and metainit & metattach (may be i have made wrong steps, causing the errors below because I have done thru some document... (1 Reply)
Discussion started by: shafeeq
1 Replies
Login or Register to Ask a Question