Link to home
Start Free TrialLog in
Avatar of wynacht
wynacht

asked on

New to C

I'm new to C and am learning it through an extension course at Cal Berkeley. The text we are using is "The Art and Science of C" by Eric Roberts.

The text requires us to use some additional user-included libraries, but doesn't tell us how to set them up. Obviously, that depends on your compiler and the environment you are working in. He provides the header and source files and says to do the following.

1. Put the header files in the include directory of your compiler. (This was easy).

2. Compile the source files to produce the appropriate object files. (This I can do as well).

3. Put the object files into a library file. (This I don't know how to do.

I'm using Microsoft's Visual C++ v4.1 for this class. I've tried to do this many different ways, but have yet to figure it out. Every time I use the following include statement:

#include "genlib.h"

I get a linking error.

What am I doing wrong? Please help!!!

Thanks!!

Jon Wynacht
jonw@accountmate.com
Avatar of Slarti
Slarti

The headers are probably intended for a textmode OS like Unix or DOS. VC++ is by default a Windows compiler. There should be some way to tell VC to simulate a DOS window (actually makes a Windows programs that uses ordinary ANSI C I/O libraries). In Borland C++ this is called EasyWin. I believe in VC it's called QuickWin or something, I'm not sure. Anyone?

ASKER CERTIFIED SOLUTION
Avatar of vanbasco
vanbasco

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
genlib.h most likely references some functions in the object files you didn't know how to make into libraries.  I'm not familier with VC++, but I'm sure there's a command to combine .OBJ files into one .LIB file.  You may try looking at VC's help.  One thing about Windows is you don't need to look through command line options to find out how to do something, you just need to click on Help ;)