Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Newbie Struggling With Program

24 views
Skip to first unread message

pa...@burkander.com

unread,
May 8, 2012, 1:31:52 PM5/8/12
to
Hi all,

I'm really a beginner, and I may be doing something stupid, but I'd very much appreciate any help in straightening me out.

I'm using LCC to run some C code written by the Center for Advanced Studies in Measurement & Assessment. The exact programs can be found here: http://www.education.uiowa.edu/en/programs.aspx.

It comes with some user written libraries, notably ERutilities.h and ER.h. It took me some time to realize that I could put these files in the same folder as my .c file. However, when I attempt to compile, I'm told there's an undefined reference to _ReadFdGet_USTATS - and there are several other such errors.

After minimal digging around, I found that in the ERutilities.h file, ReadFdGet_USTATS is defined, as

void ReadFdGet_USTATS(char fname[], int scol, int fcol, double min, double max, double inc, char id,struct USTATS *s);

Why is it that the reference is undefined? Is it somehow not correctly loading the .h file?

Thanks much,
Paul

steve

unread,
May 8, 2012, 10:05:24 PM5/8/12
to
On May 8, 10:31 am, p...@burkander.com wrote:


I find no source code at the page you linked to.

>>Why is it that the reference is undefined?
>>Is it somehow not correctly loading the .h file?

You haven't provided any code for anyone to see what's wrong.
Show the code where you are declaring your headers and functions.

Roberto Waltman

unread,
May 9, 2012, 8:18:55 AM5/9/12
to
I do not use LCC, so my answers are generic, you'll have to fill in
the details.

>It comes with some user written libraries, notably ERutilities.h and ER.h.
These are not libraries, these are "header files". They contain
definitions that let your code use functions provided somewhere else.
That somewhere else are the actual libraries.

> It took me some time to realize that I could put these files in the same folder as my .c file.
Or, you could have told the compiler where to find the header files
with the proper parameters, project setup, etc.

> However, when I attempt to compile, I'm told there's an undefined reference to _ReadFdGet_USTATS - and there are several other such errors.
Link time errors, no compile errors. That is, your program references
("tries to use") ReadFdGet_USTATS, the included header file lets your
code know that there is indeed such a function, what parameters it
takes, etc, but the actual code for ReadFdGet_USTATS is not provided.
(Again, the header file *is not* the library)

>After minimal digging around, I found that in the ERutilities.h file, ReadFdGet_USTATS is defined, as
>void ReadFdGet_USTATS(char fname[], int scol, int fcol, double min, double max, double inc, char id,struct USTATS *s);
>Why is it that the reference is undefined? Is it somehow not correctly loading the .h file?

Header files are not "loaded", they are "included" and they are
included correctly.
You still need to add to your project and compile the files containing
the actual source code for these functions.

>Thanks much,
>Paul
--
Roberto Waltman

[ Please reply to the group,
return address is invalid ]
0 new messages