Sponsored Content
Top Forums Programming C files searching and Linking Post 302166494 by user_prady on Tuesday 12th of February 2008 04:03:05 AM
Old 02-12-2008
C files searching and Linking

Dear friends,

First off all , let me apologize for my inexperience. I am just starting use of Linux and gcc .

Actually I ve some .c files in the present directory , and now I am
giving
Code:
 +vc <my_file1.c> <my.file2.c> <myfile3.c>.

All the c files are in present directory. Then my Vcs Tool automatically calls the gcc command for me ..
Like
Code:
gcc  -pipe -m32 -O -I/user/vcs_mx/2006.06/include -c ./my_file1.c
gcc  -pipe -m32 -O -I/user/vcs_mx/2006.06/include -c ./my_file2.c
gcc  -pipe -m32 -O -I/user/vcs_mx/2006.06/include -c ./my_file3.c

But my problem is I want to store all these .c files in a src directory and call it from there..But not using absolute path name for all files..

I guess there -Idir/Ldir for directory search , But I tried seems to be not working .

Thanks for your help..

Regards,

Last edited by vino; 02-12-2008 at 05:26 AM.. Reason: arranged the code tags
 

10 More Discussions You Might Find Interesting

1. Programming

compiling and linking 2 C files ...??

Hi mates, I am trying to copile and link to C programs with command: cc file1,file2 but i raises the error "file not found" ... am i doing the right way? any suggestion will be appreciated. thanks abdul (4 Replies)
Discussion started by: abdul
4 Replies

2. UNIX for Dummies Questions & Answers

Searching files..?

hi there can anyone tell me how to search and copy files under unix? im writing shell scripts with 'vi' and 'pico' something like read directoryName if then echo Copying the files copy those *.src files to sub1(another directory) using cp else ... (4 Replies)
Discussion started by: nickaren
4 Replies

3. Programming

Linking problem while linking to shared library

Hi I'm getting ld: fatal: option -h and building a dynamic executable are incompatible ld: fatal: Flags processing errors When I run ld -shared -L/usr/dt/lib -lDtSvc -o builtin.so Workspace.o after running gcc -fPIC -I/usr/X11R6/include -I/usr/dt/include -c Workspace.c I'm... (6 Replies)
Discussion started by: laho
6 Replies

4. UNIX for Dummies Questions & Answers

modifying C file and linking back to project files

hi, This is the first time I work in a big C project. All source code files are located in say directory /source/pp and all header files are in /include/pp. I've created a link to both of these directories from my home dir, say /home/ss. So in the /home/ss dir I have the /source/pp and /include/pp... (1 Reply)
Discussion started by: bruins2005
1 Replies

5. UNIX for Dummies Questions & Answers

Linking Files in UNIX (shortcuts)

Hello, Can anyone tell me how I can make a file link or shortcut in UNIX 4.0, several file links where damaged during an outage examples below. Examples: file -> file libX11.so -> /usr/shlib/libX11.so.pre.O3D All of the file links that were damaged were in /shlib and point to... (3 Replies)
Discussion started by: jays337
3 Replies

6. Shell Programming and Scripting

Recursively hard linking files -- bonehead question

I used to program ksh a while back, but I've been off in Oracle/Windows land (for clients -- not by choice) for so long that I can't remember what should be an easy thing. Here's the scenario: 1)Find all files and directories beneath some directory point (A). 2)If directory, make the... (7 Replies)
Discussion started by: scyphers
7 Replies

7. UNIX for Advanced & Expert Users

Searching for files

Hi, I have the following command to list files beginning with a specific name and containing some text... find . -type f -name "dm_merge_domain_adm*" -exec grep -il "Error Message:" '{}' \; -print|xargs ls -ltr It works fine, but seems to list two of each file, when they only exist once...any... (1 Reply)
Discussion started by: chrislluff1976
1 Replies

8. Shell Programming and Scripting

Searching across multiple files if pattern is available in all files searched

I have a list of pattern in a file, I want each of these pattern been searched from 4 files. I was wondering this can be done in SED / AWK. say my 4 files to be searched are > cat f1 abc/x(12) 1 abc/x 3 cde 2 zzz 3 fdf 4 > cat f2 fdf 4 cde 3 abc 2... (6 Replies)
Discussion started by: novice_man
6 Replies

9. Shell Programming and Scripting

Script for linking files with paths in 2 text files

I have 2 txt files, 1.txt and 2.txt which contain the paths to files that need to be linked. Example 1.txt: /root/001/folder2/image4.nii.gz /root/002/folder2/image4.nii.gz Example 2.txt: /root/001/folder2/image5.nii.gz /root/002/folder2/image5.nii.gz Each line represents images from... (7 Replies)
Discussion started by: LeftoverStew
7 Replies

10. Programming

Linker errors linking to .a files on OS X

Basically my problem is that when I try to compile anything using ./configure && make, it fails because of linker errors. I can reproduce the behavior I'm getting as follows: I have the two following files main.c: #include <stdio.h> extern void func(void); int main(int argc, char... (5 Replies)
Discussion started by: MarshallBanana
5 Replies
GCJH(1) 								GNU								   GCJH(1)

NAME
gcjh - generate header files from Java class files SYNOPSIS
gcjh [-stubs] [-jni] [-add text] [-append text] [-friend text] [-preprend text] [--classpath=path] [--CLASSPATH=path] [-Idir...] [-d dir...] [-o file] [-td dir] [-M] [-MM] [-MD] [-MMD] [--version] [--help] [-v] [--verbose] classname... DESCRIPTION
The "gcjh" program is used to generate header files from class files. It can generate both CNI and JNI header files, as well as stub implementation files which can be used as a basis for implementing the required native methods. OPTIONS
-stubs This causes "gcjh" to generate stub files instead of header files. By default the stub file will be named after the class, with a suf- fix of .cc. In JNI mode, the default output file will have the suffix .c. -jni This tells "gcjh" to generate a JNI header or stub. By default, CNI headers are generated. -add text Inserts text into the class body. This is ignored in JNI mode. -append text Inserts text into the header file after the class declaration. This is ignored in JNI mode. -friend text Inserts text into the class as a "friend" declaration. This is ignored in JNI mode. -prepend text Inserts text into the header file before the class declaration. This is ignored in JNI mode. --classpath=path --CLASSPATH=path -Idirectory -d directory -o file These options are all identical to the corresponding gcj options. -o file Sets the output file name. This cannot be used if there is more than one class on the command line. -td directory Sets the name of the directory to use for temporary files. -M Print all dependencies to stdout; suppress ordinary output. -MM Print non-system dependencies to stdout; suppress ordinary output. -MD Print all dependencies to stdout. -MMD Print non-system dependencies to stdout. --help Print help about "gcjh" and exit. No further processing is done. --version Print version information for "gcjh" and exit. No further processing is done. -v, --verbose Print extra information while running. All remaining options are considered to be names of classes. SEE ALSO
gcc(1), gcj(1), gij(1), jv-scan(1), jcf-dump(1), gfdl(7), and the Info entries for gcj and gcc. COPYRIGHT
Copyright (C) 2001, 2002 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with the Invariant Sections being ``GNU General Public License'', the Front- Cover texts being (a) (see below), and with the Back-Cover Texts being (b) (see below). A copy of the license is included in the man page gfdl(7). gcc-3.2.2 2003-02-25 GCJH(1)
All times are GMT -4. The time now is 03:02 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy