Sponsored Content
Top Forums Programming How to make use others' C library installed not for the system-wide (Ubuntu/Linux)? Post 303043000 by GRMartin on Wednesday 15th of January 2020 02:05:02 PM
Old 01-15-2020
You can compile and link using compiler options. The library is referenced using -l<its_name_here> and the path to the library using -L/path/to/lib.


-I is for the path to include directories.


However, if the library isn't in a directory in the linkers path when you run the executable you'll get an error. One way to solve this is to use rpath option.


someting like:

Code:
gcc -Wall -O3 -o vcf_parser01 vcf.c vcf_parser01.c -Wl,-rpath,/home/yifangt/Study/C/VCF -L/home/yifangt/Study/C/VCF -lhtslib-1.10.2  2>err.txt


Note: I'm guessing what you need and what each item is. -I should be used with the path to header -l prepended to the library name and -L preceding the path to the library.

Last edited by GRMartin; 01-15-2020 at 03:22 PM..
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

links working system wide

I have created symbolic links to several frequently used commands, for example: "lt" is a link to "ls -ltrgo|tail". What can I do to make these links available system-wide, or at least in the directories my coworkers are in most of the time? I have copied the link to several directories, and... (6 Replies)
Discussion started by: jpprial
6 Replies

2. UNIX for Advanced & Expert Users

System wide CDE setup

Does anyone know how to make system wide changes to the CDE's front panel icons? I dont know if it matters but im running Solaris 9. THanks (1 Reply)
Discussion started by: meyersp
1 Replies

3. UNIX for Dummies Questions & Answers

FIND function - system wide

Hi, I have a task to search for a file called 'Xstartup' in the whole system because there might be different versions of it which overrite eachother. Can anyone suggest a smart command to run this search ? The machine needs to scan every single folder beginning from root. Please help, I am... (5 Replies)
Discussion started by: DGoubine
5 Replies

4. Filesystems, Disks and Memory

How to mount/make a FAT system on Linux

Yea i was wondering how i would mount, and create a FAT directory that way i can save files in the FAT directory in a windows system and be able to access them on Linux systems. Or if there is any other way to share files between Linux and Windows. Any responds will help... thanks! (2 Replies)
Discussion started by: kyoist
2 Replies

5. Shell Programming and Scripting

system wide password change

Hello, I am new to shell scripting and I was trying to write a script that would force a system wide password change except for admins. I am having some trouble and any help that someone could give me would be greatly appreciated. I am trying to do it by using the UID as the marker for anyone... (6 Replies)
Discussion started by: kilemark
6 Replies

6. Linux

System wide find and sort

Hi, I need to look for a config file (ldap.conf) and pick the latest modified file. `locate` tells me there are many ldap.conf's, some in /etc, /usr, /home, etc. Is there some way I can sort them by last modified time via bash? I was thinking maybe I could pipe the output of `locate` to `ls... (4 Replies)
Discussion started by: Housni
4 Replies

7. Linux

How to run User-mode Linux installed with synaptic package manager in Ubuntu 10.10

I have installed user-mode linux kernel in Ubuntu 10.10 with the help of Synaptic package manager. But I'm not getting how to run it. If we install it manually, we've to run it using the executable binary file. But here, I'm unable to locate any such file. Please help.... Thanking You.... ... (0 Replies)
Discussion started by: rohitadeshmukh1
0 Replies

8. Red Hat

Changing system-wide for umask

Hi everybody, How can I change the default UMASK for non root users, e.g. I want the umask for every new created user will be 0044. Thanks (6 Replies)
Discussion started by: leo_ultra_leo
6 Replies

9. Shell Programming and Scripting

System-wide search

When looking for wherever a program or a filename appears in the system, a short scrip is "findinner" which another script calls with a long parameter list consisting of path names ending with ".sh" or ".menu". "findinner" looks like this: # If not .savenn file, show name and result of grep. #... (4 Replies)
Discussion started by: wbport
4 Replies
FAUCC(1)																  FAUCC(1)

NAME
faucc - C compiler generating Intel code for 16 bit/32 bit CPUs. SYNOPSIS
faucc [ -B path ] [ -D MACRO [=def]] [ -E ] [ -I path ] [ -L path ] [ -MD ] [-MF file ] [ -MP ] [ -MT target ] [ -O level ] [ -S ] [ -T script ] [ -U macro ] [ -Wl,arg ] [ -Xlinker arg ] [ -b arch ] [ -c ] [ -f arg ] [ -m arch ] [ -nostdlib ] [ -o output ] [ -print-lib-faucc-file-name ] [ --freestanding ] [ --no-stack-protector ] { file ...} DESCRIPTION
faucc is a C compiler, that can generate Intel 16 bit or 32 bit Code. OPTIONS
faucc tries to mimic the options of gcc. A number of options will be passed to the C preprocessor cpp or to the linker (done via a call to the c-compiler gcc) in unmodified form. -B path Override the directory prefix where cc1 is looked up with path. -D MACRO, -D MACRO=def Define MACRO with the optional initial definition def. If def is omitted, it defaults to 1. -E Only perform preprocessing, but do not run the compiler. -I path Add path to the include path in which header files are searched. -L path Add path to the library search path, in which the linker will look for libraries. -MD Output dependency information while preprocessing. -MF, file Output dependency information while preprocessing to file. -MP, When the preprocessor should output dependency information, it will generate PHONY targets for each dependency. -MT target When the preprocessor should output dependency information, use target as the dependency rule target. -O level Currently ignored. -S Output assembly code. -T script Use script as linker script. -U macro Undefine a previously defined macro. -Wl,arg, -Xlinker arg Pass arg to the linker. -b arch Generate code for arch (either i286 or i386) -c Perform compilation, but do not link. -f arg Pass code generation argument arg to the compiler. See the cc1 man page for possible arguments. -m arch Currently ignored. -nostdlib With this option, the linker will only search for libraries that are passed as command line arguments. -o file Write output to file. -print-libfaucc-file-name Print the full path of the internal compiler library libfaucc.a. -static Perform static linking. --freestanding, --no-stack-protector Currently ignored. EXAMPLES
faucc -c hello-world.c -o hello-world.o Compile the program hello-world.c and output the object as hello-wolrd.o. faucc -S -b i286 -o test.s test.c Compile the program test.c to 16 bit code and output the assembly listing to test.s, but do not assemble or link the result yet. SEE ALSO
cc1(1) , cpp(1) , gcc(1) , ld(1) CONTACT
Please report all bugs to FAUcc Team <info@faumachine.org>. FAUcc Homepage [1]. AUTHOR
FAUcc Team COPYRIGHT
Copyright (C) 2009 FAUcc Team. Developed at Friedrich Alexander University Erlangen-Nuremberg. FAUcc comes with ABSOLUTELY NO WARRANTY. FAUcc is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. See COPYING for details. NOTES
1. FAUcc Homepage http://www.faumachine.org FAUcc Team 03/08/2009 FAUCC(1)
All times are GMT -4. The time now is 11:18 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy