Difference between Unix and Linux for resolving symbols
I came across a difference between Unix and Linux, when it comes to resolving the symbols from the libs.
consider the following code segments...
Code:
$ cat call1.c
#include <stdio.h>
int a1;
extern int a3;
void prnt_a3()
{
printf("\n%d\n",a3);
}
$ cat test.c
#include <stdio.h>
extern int a1;
int main()
{
int a2=20;
printf("\n%d\n",a1);
return 0;
}
Highlights are...
* a1 is defined in call1 and is being referenced in test.c and is being used also
* a3 is referenced to in test.c and is not defined anywhere. It is being used but in a dead function prnt_a3
I am running it as
Code:
cc -g -c test.c call1.c
ar q lib.a call1.o
cc -g -o test test.o lib.a
The executable gets build in HP Unix bit in Linux, it fails saying
Code:
call1.c:6: undefined reference to `a3'
collect2: ld returned 1 exit status
I don't know the concept/rationale behind the same.
HPUx just refers to the data definitions and it doesn't bother about the functions unless there is atleast 1 function being used from that routine (in which case, HP also gives error) ???
If anyone can suggest some reading material for the same, it'll also be great.
Thanks...
Last edited by Scott; 10-17-2012 at 12:42 PM..
Reason: After almost 5 years, you should know to use code tags :)
This may/may not be a long answer to a short question.
I am learning the C programming language at home.I have seen some good books on the UNIX programming enviroment.However, there were a few books that hinted towards the Linux programming enviroment.Is there any difference between the two as... (1 Reply)
Ok, I'm confused.
Can someone answer these (stupid) questions please for me?
1. What is the difference between unix and linux?
2. Is FreeBSD a unix distribution?
3. If not, then what is Unix? I actually gone to Unix.com because I thought this is it's official website where I could download... (1 Reply)
OK, I've used various versions of UNIX(Solaris, HPUX, etc..) over the years. Now the organization I work for is leaning towards more Linux based systems(Redhat, Suse, etc..)
I do see differences in in comands and how to accomplish basic adminstration, but nothing mind blowing.
So, what is it... (5 Replies)
:confused: Hi All
Can anyone help me in finding the answer of the question mentioned below.
What is the difference between Unix & linux ?
Thanks in Advance to all
CSaha (1 Reply)
Sir ,
Can any body explain the difference between linux , Unix and AIx on command Reference all the command on AIx and unix is same or not
please reply (2 Replies)
Hi,
I am using some codes that have been ported from unix to linux, and now the sorting no longer results in the desired ordering. I'm hoping to find a way to mimic the unix sort command in linux. The input file is structured the following:
$> cat file.txt... (6 Replies)
Hi Guys,
I am trying to test installation of a local rpm to my RHEL5 server. I am expecting it to fail as a previous version of the same package name exists. On using rpm -i this behaves as expected but yum install does not pick up the conflict. Here is the element of my SPEC file with the... (5 Replies)
hi experts please tell me the real difference between unix and linux at kernel structure (1 Reply)
Discussion started by: linurag
1 Replies
LEARN ABOUT SUSE
xft-config
xft-config(1) General Commands Manual xft-config(1)NAME
xft-config - report Xft version, compiler, linker, and/or installation directory information
SYNOPSIS
xft-config { --exec-prefix[=local_prefix] | --prefix[=local_prefix] | --cflags | --libs } ...
xft-config --version
DESCRIPTION
xft-config reports information of interest to users and developers about the installed version of the X FreeType library, Xft(3). Depend-
ing on how it is invoked, xft-config reports the installed version of Xft, the compiler and linker flags that are required to successfully
compile and link C (or C-compatible) code that uses the library, and/or the directories used by the GNU Autotools to install its files.
Note that if the system's installed version of Xft came from an OS vendor or other third party, the actual location of its files may differ
from those reported by xft-config. The system adminstrator can also relocate Xft's files.
If invoked without any arguments, xft-config will print a usage message on standard error and exit.
OPTIONS --cflags
Report the compiler flags that are required to compile code that uses Xft symbols.
--exec-prefix[=local_prefix]
If specified without the parameter local_prefix, report the file specification prefix that Xft uses for installation of executable
files. If local_prefix is specified, it is used instead of the file specification prefix used for installation of executable files
by Xft and the value of the option argument specified with --prefix, if any, when compile and linker flags are reported (with
--cflags and --libs, respectively).
--libs Report the linker flags that are required to link code that uses Xft symbols.
--prefix[=local_prefix]
If specified without the parameter local_prefix, report the file specification prefix that Xft uses for installation of files. If
local_prefix is specified, it is used instead of the file specification prefix used for installation of files by Xft when compile
and linker flags are reported (with --cflags and --libs, respectively); also see --exec-prefix.
--version
Report the version of the Xft library installed on the system and exit.
OPERANDS
xft-config does not recognize any non-option arguments. At least one option must be specified.
EXIT STATUS
0 Information was successfully reported.
1 xft-config was invoked with invalid arguments, or no arguments at all.
AUTHOR
xft-config was written by Keith Packard. This manual page was written by Branden Robinson.
SEE ALSO Xft(3)Xft Version 2.1.14 xft-config(1)