Solved

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

Posted on 2009-06-30
2
790 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

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…
Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
The goal of this video is to provide viewers with basic examples to understand opening and reading files 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.

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now