The continuing saga of "C compiler cannot create executables"

2007-12-24 19:44:00

OK. Everyone says I should not have to set LD_LIBRARY_PATH. Makes
sense to me. But if I don't, then I can't compile because the compiler
can not find the libraries. I did not compile GCC, I downloaded the
pre-compiled package from www.sunfreeware.com and added it. I resolved
my immediate problem with compiling the tool I needed, but it seems I
have a larger issue that needs to be addressed. Everyone has asked for
more information, so here it is:

My user Environment
-------------------
$ env
APP_DEFS=3D/usr/openwin/lib/app-defaults
CC=3D/usr/local/bin/gcc
EDITOR=3Dvi
HOME=3D/export/home/psimpson
HZ=3D100
LOGNAME=3Dpsimpson
MAIL=3D/var/mail/psimpson
MANPATH=3D/usr/man:/usr/local/man:/usr/share/man:/opt/OV/man
NETFMT=3D/opt/OV/bin/netfmt
NETFMT_LOG_FILE=3D/var/opt/OV/log/nettl.LOG00
NETFMT_TRC_FILE=3D/var/opt/OV/log/nettl.TRC0
NETTL=3D/opt/OV/bin/nettl
OV_ANALYSIS_CONF=3D/etc/opt/OV/share/conf/analysis
OV_BACKGROUNDS=3D/etc/opt/OV/share/backgrounds
OV_BIN=3D/opt/OV/bin
OV_BITMAPS=3D/etc/opt/OV/share/bitmaps
OV_CONF=3D/etc/opt/OV/share/conf
OV_CONTRIB=3D/opt/OV/contrib
OV_DB=3D/var/opt/OV/share/databases
OV_DOC=3D/opt/OV/doc
OV_FIELDS=3D/etc/opt/OV/share/fields
OV_HEADER=3D/opt/OV/include
OV_HELP=3D/var/opt/OV/share/help
OV_LIB=3D/opt/OV/lib
OV_LOG=3D/var/opt/OV/share/log
OV_LRF=3D/etc/opt/OV/share/lrf
OV_MAIN_PATH=3D/opt/OV
OV_MAN=3D/opt/OV/man
OV_NEW_CONF=3D/opt/OV/newconfig
OV_NLS=3D/opt/OV/lib/nls
OV_PRIV_LOG=3D/var/opt/OV/log
OV_PROG_SAMPLES=3D/opt/OV/prg_samples
OV_REGISTRATION=3D/etc/opt/OV/share/registration
OV_SHARE_HTDOCS=3D/var/opt/OV/www/htdocs
OV_SHARE_LOG=3D/var/opt/OV/share/log
OV_SNMP_MIBS=3D/var/opt/OV/share/snmp_mibs
OV_SOCKETS=3D/var/opt/OV/sockets
OV_STACKS=3D/etc/opt/OV/stacks
OV_SYMBOLS=3D/etc/opt/OV/share/symbols
OV_TMP=3D/var/opt/OV/tmp
OV_WWW=3D/opt/OV/www
OV_WWW_REG=3D/etc/opt/OV/share/www/registration
PATH=3D/usr/local/bin:/usr/bin:/usr/sbin:/usr/ccs/bin:/usr/ucb:/opt/OV/bi=
n
:/export/home/psimpson/bin:/usr/local/bin:/opt/netscape:/usr/ccs/lib:/us
r/include
SHELL=3D/bin/sh
TERM=3Dvt100
TZ=3DUS/East-Indiana
_DVFS_RECONFIG=3DYES

Test C Program
--------------
$ cat hello.c
#include <stdio.h>

main() {
printf ("Hello World.\n");
}

Compiler Output
---------------
$ gcc hello.c
ld: fatal: ld.so.1: /usr/ccs/bin/ld: fatal: relocation error: file
/usr/ccs/lib/libld.so.2: symbol dbg_mask: referenced symbol not found
collect2: ld returned 1 exit status

GCC Version
-----------
$ gcc -v
Reading specs from
/usr/local/lib/gcc-lib/sparc-sun-solaris2.6/2.95.2/specs
gcc version 2.95.2 19991024 (release)

uname -a Output
---------------
$ uname -a
SunOS hostname.subnet.realmed.com 5.6 Generic_105181-25 sun4u sparc
SUNW,Ultra-5_10

Installed Packages
------------------
$ pkginfo -i
application APapache apache
application BMvim vim
application CUsudo sudo
application FSFbash bash
application FSFbison bison
application FSFflex flex
application FSFgzip gzip
application LWperl perl
application POWRpixvw Integration for Cisco PIX firewalls into HP
OpenView Network Node Manager.
application SMCgcc gcc
system SUNWab2m Solaris Documentation Server Lookup
system SUNWaccr System Accounting, (Root)
system SUNWaccu System Accounting, (Usr)
system SUNWadmap System administration applications
system SUNWadmc System administration core libraries
system SUNWadmfw System & Network Administration Framework
system SUNWadmr System & Network Administration Root
system SUNWarc Archive Libraries
system SUNWast Automated Security Enhancement Tools
system SUNWatfsr AutoFS, (Root)
system SUNWatfsu AutoFS, (Usr)
system SUNWaudio Audio applications
system SUNWbcp SunOS 4.x Binary Compatibility
system SUNWbtool CCS tools bundled with SunOS
system SUNWcar Core Architecture, (Root)
system SUNWcg6 GX (cg6) Device Driver
system SUNWcg6h GX (cg6) Header Files
system SUNWcpr Suspend, Resume package
system SUNWcsd Core Solaris Devices
system SUNWcsr Core Solaris, (Root)
system SUNWcsu Core Solaris, (Usr)
system SUNWdfb Dumb Frame Buffer Device Drivers
system SUNWdfbh Dumb Frame Buffer Header Files
system SUNWdoc Documentation Tools
system SUNWdtbas CDE application basic runtime environment
system SUNWdtcor Solaris Desktop /usr/dt filesystem anchor
system SUNWdtdmn CDE daemons
system SUNWdtdst CDE Desktop Applications
system SUNWdtdte Solaris Desktop Login Environment
system SUNWdthe CDE HELP RUNTIME
system SUNWdthev CDE HELP VOLUMES
system SUNWdthj HotJava Browser for Solaris
system SUNWdticn CDE icons
system SUNWdtim Solaris CDE Image Viewer
system SUNWdtlog System boot for Desktop Login
system SUNWdtrme CDE Release Documentation
system SUNWdtwm CDE DESKTOP WINDOW MANAGER
system SUNWenise Base Partial Locales
system SUNWesu Extended System Utilities
system SUNWeuise European Partial Locales
system SUNWfns Federated Naming System
system SUNWhea SunOS Header Files
system SUNWhmd SunSwift SBus Adapter Drivers
system SUNWhmdu SunSwift SBus Adapter Headers
system SUNWide IDE device drivers
system SUNWinst Install Software
system SUNWipc Interprocess Communications
system SUNWislcc XSH4 conversion for Eastern European locales
system SUNWisolc XSH4 conversion for ISO Latin character sets
system SUNWjvjit Java JIT compiler
system SUNWjvrt JavaVM run time environment
system SUNWkey Keyboard configuration tables
system SUNWkvm Core Architecture, (Kvm)
system SUNWlibC SPARCompilers Bundled libC
system SUNWlibCf SunSoft WorkShop Bundled libC (cfront
version)
system SUNWlibm Sun WorkShop Bundled libm
system SUNWlibms Sun WorkShop Bundled shared libm
system SUNWloc System Localization
system SUNWlpmsg LP Alerts
system SUNWm64 M64 System Software (Device Driver)
application SUNWm64cf M64 Graphics Configuration Software
application SUNWm64w M64 Window System Support
system SUNWman On-Line Manual Pages
system SUNWmfrun Motif RunTime Kit
system SUNWmibii Solstice Enterprise Agent SNMP daemon
system SUNWnisr Network Information System, (Root)
system SUNWnisu Network Information System, (Usr)
system SUNWntpr NTP, (Root)
system SUNWntpu NTP, (Usr)
system SUNWolaud OPEN LOOK Audio applications
system SUNWolbk OpenWindows online handbooks
system SUNWoldcv OPEN LOOK document and help viewer
applications
system SUNWoldst OPEN LOOK deskset tools
system SUNWoldte OPEN LOOK Desktop Environment
system SUNWolimt OPEN LOOK imagetool
system SUNWolinc OPEN LOOK include files
system SUNWolrte OPEN LOOK toolkits runtime environment
system SUNWos86u Platform Support, OS Functionality (Usr)
system SUNWowbcp OpenWindows binary compatibility
system SUNWowrqd OpenWindows required core package
system SUNWpcelx 3COM EtherLink III PCMCIA Ethernet Driver
system SUNWpci PCI Simba device drivers
system SUNWpcmci PCMCIA Card Services, (Root)
system SUNWpcmcu PCMCIA Card Services, (Usr)
system SUNWpcmem PCMCIA memory card driver
system SUNWpcr SunSoft Print - Client, (root)
system SUNWpcser PCMCIA serial card driver
system SUNWpcu SunSoft Print - Client, (usr)
system SUNWpd PCI Drivers
system SUNWploc Partial Locales
system SUNWploc1 Supplementary Partial Locales
system SUNWplow OpenWindows enabling for Partial Locales
system SUNWpmowr Power Management OW Utilities, (Root)
system SUNWpmowu Power Management OW Utilities, (Usr)
system SUNWpmr Power Management config file and rc script
system SUNWpmu Power Management binaries
system SUNWpsdpr PCMCIA ATA card driver
system SUNWpsf PostScript filters - (Usr)
system SUNWpsr SunSoft Print - LP Server, (root)
system SUNWpsu SunSoft Print - LP Server, (usr)
system SUNWpwb Power Button Driver
system SUNWpwbow Power Button OW Utility
system SUNWqfed Sun Quad FastEthernet Adapter Driver
system SUNWrdm On-Line Open Issues ReadMe
system SUNWsacom Solstice Enterprise Agent files for root file
system
system SUNWsadmi Solstice Enterprise Agent Desktop Management
Interface
system SUNWsasnm Solstice Enterprise Agent Simple Network
Management Protocol
system SUNWscbcp SPARCompilers Binary Compatibility Libraries
system SUNWscplp SunSoft Print - Source Compatibility, (Usr)
system SUNWscpr Source Compatibility, (Root)
system SUNWscpu Source Compatibility, (Usr)
system SUNWsolnm Solaris Naming Enabler
system SUNWspl Spell Checking Engine - Base Release
(English)
system SUNWsprot Solaris Bundled tools
system SUNWsra Source Compatibility Archive Libraries
system SUNWsregu Solaris User Registration
system SUNWsrh Source Compatibility Header Files
system SUNWsutl Static Utilities
system SUNWswmt Patch Utilities
system SUNWtltk ToolTalk runtime
system SUNWtltkd ToolTalk developer support
system SUNWtoo Programming Tools
system SUNWvolg Volume Management Graphical User Interface
system SUNWvolr Volume Management, (Root)
system SUNWvolu Volume Management, (Usr)
system SUNWvplr SMCC sun4u new platform links
system SUNWvplu SMCC sun4u new usr/platform links
system SUNWvplxw Sun4u-platform specific X server
supplementary links
system SUNWxcu4 XCU4 Utilities
system SUNWxfb Elite3D/FFB (Creator) Common Driver Routines
application SUNWxgldg XGL Generic Loadable Libraries
application SUNWxgler XGL English Localization
application SUNWxglft XGL Stroke Fonts
application SUNWxglh XGL Include Files
application SUNWxglrt XGL Runtime Environment
application SUNWxildh XIL Loadable Pipeline Libraries
application SUNWxilow XIL Deskset Loadable Pipeline Libraries
application SUNWxilrl XIL Runtime Environment
application SUNWxilvl VIS/XIL Support
system SUNWxwacx AccessX client program
system SUNWxwcft X Window System common (not required) fonts
system SUNWxwdv X Windows System Window Drivers
system SUNWxwfnt X Window System platform required fonts
system SUNWxwfs Font server
system SUNWxwice ICE components
system SUNWxwinc X Window System include files
system SUNWxwmod OpenWindows kernel modules
system SUNWxwopt nonessential MIT core clients and server
extensions
system SUNWxwplt X Window System platform software
system SUNWxwpsr Sun4u-platform specific X server auxiliary
filter modules
system SUNWxwrtl X Window System & Graphics Runtime Library
Links in /usr/lib
application USCdig dig
application UWpine pine
application VJtr traceroute
application WLtop top

Comments

Got something to say?

You must be logged in to post a comment.