Solved

Error compiling C file with gcc (too many arguments...)

Posted on 2009-06-30
2
793 Views
Last Modified: 2012-05-07
I'm trying to compile a C library file and here's the snippet:

double avg_years(int ddnum, long date, int *s_c, const short PROXIMITY)
  {
  long *d_ptr;
  int i, count, *diff;
  double avgs, *diffs;

  d_ptr=get_dates(ddnum, date, &count, s_c, PROXIMITY);

Using gcc with options -m64, -g, -ansi I am getting this error:

avg_years.c:250: error: too many arguments to function `get_dates'

The get_dates function is declared in header file as:

extern long *get_dates(int, long, int *, int *, const short);

Any help appreciated!

Thanks,
Karen
0
Comment
Question by:KarenNewton
2 Comments
 
LVL 12

Expert Comment

by:Let_Me_Be
ID: 24747824
Is this the line the compiler is refering to?
0
 

Accepted Solution

by:
KarenNewton earned 0 total points
ID: 24748042
Problem solved, appears the header file was defining the function without the const short.. I must have gotten this mixed up with another function, been a long day. Sorry if I've wasted anybody's time.

Thank you,
Karen
0

Featured Post

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
logging Access violation 6 19
Could someone please explain the following output from a linux based ldd -v  command? 6 139
Line meaning 9 88
Super Scope, DHCP 5 91
An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays in the C programming language.

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question