Solved

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

Posted on 2009-06-30
2
800 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand and use pointers 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.

624 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