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
GCCGO(1)								GNU								  GCCGO(1)

NAME
gccgo - A GCC-based compiler for the Go language SYNOPSIS
gccgo [-c|-S] [-g] [-pg] [-Olevel] [-Idir...] [-Ldir...] [-o outfile] infile... Only the most useful options are listed here; see below for the remainder. DESCRIPTION
The gccgo command is a frontend to gcc and supports many of the same options. This manual only documents the options specific to gccgo. The gccgo command may be used to compile Go source code into an object file, link a collection of object files together, or do both in sequence. Go source code is compiled as packages. A package consists of one or more Go source files. All the files in a single package must be compiled together, by passing all the files as arguments to gccgo. A single invocation of gccgo may only compile a single package. One Go package may "import" a different Go package. The imported package must have already been compiled; gccgo will read the import data directly from the compiled package. When this package is later linked, the compiled form of the package must be included in the link command. OPTIONS
-Idir Specify a directory to use when searching for an import package at compile time. -Ldir When linking, specify a library search directory, as with gcc. -fgo-pkgpath=string Set the package path to use. This sets the value returned by the PkgPath method of reflect.Type objects. It is also used for the names of globally visible symbols. The argument to this option should normally be the string that will be used to import this package after it has been installed; in other words, a pathname within the directories specified by the -I option. -fgo-prefix=string An alternative to -fgo-pkgpath. The argument will be combined with the package name from the source file to produce the package path. If -fgo-pkgpath is used, -fgo-prefix will be ignored. Go permits a single program to include more than one package with the same name in the "package" clause in the source file, though obviously the two packages must be imported using different pathnames. In order for this to work with gccgo, either -fgo-pkgpath or -fgo-prefix must be specified when compiling a package. Using either -fgo-pkgpath or -fgo-prefix disables the special treatment of the "main" package and permits that package to be imported like any other. -fgo-relative-import-path=dir A relative import is an import that starts with ./ or ../. If this option is used, gccgo will use dir as a prefix for the relative import when searching for it. -frequire-return-statement -fno-require-return-statement By default gccgo will warn about functions which have one or more return parameters but lack an explicit "return" statement. This warning may be disabled using -fno-require-return-statement. -fgo-check-divide-zero Add explicit checks for division by zero. In Go a division (or modulos) by zero causes a panic. On Unix systems this is detected in the runtime by catching the "SIGFPE" signal. Some processors, such as PowerPC, do not generate a SIGFPE on division by zero. Some runtimes do not generate a signal that can be caught. On those systems, this option may be used. Or the checks may be removed via -fno-go-check-divide-zero. This option is currently on by default, but in the future may be off by default on systems that do not require it. -fgo-check-divide-overflow Add explicit checks for division overflow. For example, division overflow occurs when computing "INT_MIN / -1". In Go this should be wrapped, to produce "INT_MIN". Some processors, such as x86, generate a trap on division overflow. On those systems, this option may be used. Or the checks may be removed via -fno-go-check-divide-overflow. This option is currently on by default, but in the future may be off by default on systems that do not require it. SEE ALSO
gpl(7), gfdl(7), fsf-funding(7), gcc(1) and the Info entries for gccgo and gcc. COPYRIGHT
Copyright (c) 2010-2013 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.3 or any later version published by the Free Software Foundation; with no Invariant Sections, 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). (a) The FSF's Front-Cover Text is: A GNU Manual (b) The FSF's Back-Cover Text is: You have freedom to copy and modify this GNU Manual, like GNU software. Copies published by the Free Software Foundation raise funds for GNU development. gcc-4.8.2 2014-01-20 GCCGO(1)
All times are GMT -4. The time now is 05:41 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy