Solved

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

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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

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…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
The goal of this video is to provide viewers with basic examples to understand opening and writing to 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.

932 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

14 Experts available now in Live!

Get 1:1 Help Now