Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to include headers from other software

Status
Not open for further replies.

12345671

IS-IT--Management
May 24, 2003
106
0
0
AU
My env: Radhat9 with gcc and gcc++. I did a mycode.c program, it has

#include <studio.h>
#include <comedilib.h>

The second one is not build-in gcc, it is from another software for my program. When I run,

gcc mycode.c

Of course I got error undefined reference. Can anyone tell me how to include it. THanks!!!!
 
You need to specify a few things

1. The path(s) to where your extra header files are stored
2. The path(s) to where your extra libraries are stored
3. The name(s) of your additional libraries.

Eg.
Code:
gcc -I/path/to/headers -L/path/to/libs mycode.c -lextra

The way libraries are specified is a little odd when you first see it.
Given [tt]-lextra[/tt], the actual filename will be [tt]libextra.a[/tt]

--
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top