HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: g++ and ld
Operating System - HP-UX
1833780
Members
2688
Online
110063
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2001 08:51 AM
10-13-2001 08:51 AM
g++ and ld
Is it possible, that we compile the code with
$g++ -c
and then link the objects with ld.
As i am getting the following errors when link with g++ -shared
g++: /opt/gcc/lib/libstdc++.a: linker input file unused because linking not
done
/home/manju/FiltersDepot/sunilfdk/samples/filter/CandCplus/aCC.bat[5]:
echodone compilation: not found.
/usr/ccs/bin/ld: DP relative code in file /var/tmp/ccWehcie.o - shared
library must be position
$g++ -c
and then link the objects with ld.
As i am getting the following errors when link with g++ -shared
g++: /opt/gcc/lib/libstdc++.a: linker input file unused because linking not
done
/home/manju/FiltersDepot/sunilfdk/samples/filter/CandCplus/aCC.bat[5]:
echodone compilation: not found.
/usr/ccs/bin/ld: DP relative code in file /var/tmp/ccWehcie.o - shared
library must be position
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2001 09:04 AM
10-13-2001 09:04 AM
Re: g++ and ld
The latest error for the above problem i am getting is, although i am using -fPIC while compiling
/usr/ccs/bin/ld: DP relative code in file /var/tmp/ccc0Ehoc.o - shared library must be position
independent. Use +z or +Z to recompile.
collect2: ld returned 1 exit status
/usr/ccs/bin/ld: DP relative code in file /var/tmp/ccc0Ehoc.o - shared library must be position
independent. Use +z or +Z to recompile.
collect2: ld returned 1 exit status
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2001 09:38 AM
10-13-2001 09:38 AM
Re: g++ and ld
Sunil,
did you really try like this?.
$g++ -c -fPIC abc.c
Now you can combine the object files into the shared library
$g++ -shared -fPIC -o abc.so abc.o xyz.o
-Sri
did you really try like this?.
$g++ -c -fPIC abc.c
Now you can combine the object files into the shared library
$g++ -shared -fPIC -o abc.so abc.o xyz.o
-Sri
You may be disappointed if you fail, but you are doomed if you don't try
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2001 01:30 PM
10-13-2001 01:30 PM
Re: g++ and ld
The -fPIC option to gcc (and g++) generate position independent code similar to the way the +z option does in HP's compiler.
-Santosh
-Santosh
Life is what's happening while you're busy making other plans
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP