Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2009-06-30
2
Medium Priority
?
815 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
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 how to create, access, and change arrays in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.

722 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