gcc question


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting gcc question
# 1  
Old 10-17-2006
gcc question

Hi,

I am trying to compile a .c file but in the pre-processor directives I want to include a file that I have put together myself (#include "file.h"). How can I accomplish this?
# 2  
Old 10-17-2006
Do not see any problem:

# gcc test.c -o test
# 3  
Old 10-17-2006
Thank you, Hitori. It is the first time I'm using gcc and I looked through some of the info and manual but couldn't find what I was looking for.
# 4  
Old 10-17-2006
I just tried it out and realized this is not what I want to do. The -o option speciefies the file in which to place the output. What I was looking for is the following:

#include <stdio.h>
#include <errno.h>
...
#include "path/to/dietdirent.h"

I realized I've mistyped the path to the header and now everything is fine. My apologies for the confusion.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

A question regarding the gcc compiler ...

It might be a simple one but I have this question bothering me for sometime. When we do a symbol search inside the library directory (i.e. /usr/lib/*) via tools like nm; it takes a while to give us the results. However, its very quick when gcc is invoked to compile a program with the very same... (11 Replies)
Discussion started by: Praveen_218
11 Replies

2. UNIX for Dummies Questions & Answers

Help with gcc and g++

Hi, I have recently got a job in unix, now training is going on and we have been practicing on telnet, so to practice at home I have installed vmware(virtual machine) and planning to download ubuntu. So my doubt is that whether I can write c and cpp progs in vi editor and can I run them by default... (5 Replies)
Discussion started by: vishal.973s
5 Replies

3. Solaris

gcc & linker question (Solaris 10)

Hi, I'm confused about the GCC & Linking process could somebody please briefly explain? I have GCC 3.4.6 installed from SunFreeware. Reading the narrative alongside the package states "It was compiled to use the SUN assembler and loader usually in /usr/ccs/bin if the SUNW developer packages... (1 Reply)
Discussion started by: Celtic_Monkey
1 Replies

4. Solaris

Installing gcc - recieve error message gcc : cannot execute

AIM- Install Oracle 11g on Solaris using VMWare Steps 1.Logged on as root 2.Created subfolders à /usr/local/bin & /usr/local/bin/gcc 3.Downloaded gcc & libiconv & unzipped them on my harddrive & burnt them on CD 4.Copied files from CD to /usr/local/bin/gcc 5.Terminal (root) à pkgadd -d... (8 Replies)
Discussion started by: Ackers
8 Replies

5. Programming

a very basic question regarding gcc...

hi, as the topic says.. i`m a newbie to the unix platform.. plz help me out here. i create a .c file using "vi prog.c" then write the code in it... then save n exit.. wat happend after tht.. ?? how do i compile n check the program???? i`ve been thru the manual pages of gcc but i cudn`t get... (2 Replies)
Discussion started by: caltiger
2 Replies

6. Programming

gcc *.c -lcurses

Can someone tell me what does -|curses do here when the C program got compiled? gcc *.c -lcurses Thanks! (1 Reply)
Discussion started by: whatisthis
1 Replies

7. Programming

Gcc

Dear all, Any body please guide, i require a C which will run in Linux environment. Its urgent please. warm regards, Senthil K (1 Reply)
Discussion started by: Senthil
1 Replies

8. Programming

Installing gcc

Hi all I'm trying to install the latest version of gcc but I keep getting this message on make; gcc -DHAVE_CONFIG_H -I. -I. -I. -I. -I. -I./../zlib -I./../include -W -Wall -pedantic -Wstrict-prototypes -Wmissing-prototypes -Wwrite-strings -g -O2 -c jartool.c jartool.c:234: getopt.h: No... (3 Replies)
Discussion started by: squeakywheel
3 Replies

9. UNIX for Dummies Questions & Answers

cc compiler / gcc

:confused: I have a question concerning gcc. I´d like to install the gcc on my Mac OS X, but when I try to run the configure command I get the following message: floriant% ./configure ./configure: read-only variable: PWD Configuring for a powerpc-apple-darwin5.4 host. *** This configuration... (2 Replies)
Discussion started by: florian.turck
2 Replies

10. UNIX for Dummies Questions & Answers

man gcc

Hi all, How can I get man page to recognize gcc when i need to look up gcc options? I tried "man gcc" but got a response "no manual entry for gcc". Thanks a bunch, Rachael (10 Replies)
Discussion started by: rachael
10 Replies
Login or Register to Ask a Question