HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- ld: Duplicate symbol "x" in files
Operating System - HP-UX
1834827
Members
2850
Online
110070
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
05-05-2005 04:48 AM
05-05-2005 04:48 AM
ld: Duplicate symbol "x" in files
I have code that compiles and links without incident on an 11.23 system with the aCC 5.55 compiler/linker.
That same code on an 11.11 (aCC 3.55) generates the following:
ld: Duplicate symbol "x" in files filex and filey
ld: Duplicate symbol "y" in files filex and filey
It usually prints both lines for each item in the link line.
This only seems to happen when I am making a shared library: aCC -b -o rick.sl filex.o filey.o
Now the compiler doc says something about it but it has to do with templates. I am not using templates. If I take the doc into consideration regarding auto instantiation and the like I end up running into problems with shared libraries linking but not the executable and it becomes a problem with fixing it one palce only to have it popout in another place.
There is something else at work here, any suggestions?
Thanks,
Rick
That same code on an 11.11 (aCC 3.55) generates the following:
ld: Duplicate symbol "x" in files filex and filey
ld: Duplicate symbol "y" in files filex and filey
It usually prints both lines for each item in the link line.
This only seems to happen when I am making a shared library: aCC -b -o rick.sl filex.o filey.o
Now the compiler doc says something about it but it has to do with templates. I am not using templates. If I take the doc into consideration regarding auto instantiation and the like I end up running into problems with shared libraries linking but not the executable and it becomes a problem with fixing it one palce only to have it popout in another place.
There is something else at work here, any suggestions?
Thanks,
Rick
- Tags:
- duplicate
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2005 07:01 PM
05-12-2005 07:01 PM
Re: ld: Duplicate symbol "x" in files
Rick,
It looks like that the aCC 3.55 is taking an exception to same variables/objects being declared in two object files that you are trying to link together. You may want to check that the variables are not the same. If you need the names to be same then you could put them in a header file and declare them as extern.
Hope this helps.
Regards,
Kamesh Prayag
It looks like that the aCC 3.55 is taking an exception to same variables/objects being declared in two object files that you are trying to link together. You may want to check that the variables are not the same. If you need the names to be same then you could put them in a header file and declare them as extern.
Hope this helps.
Regards,
Kamesh Prayag
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2005 09:04 PM
05-12-2005 09:04 PM
Re: ld: Duplicate symbol "x" in files
If your 2 x must be different, then you must declare them as static,
If they must be shared you must set them as extern.
If they are different, but you can't change them to static then you can hide them doing a
ld -r filex.o -h x -h y -o filex2.o
If they must be shared you must set them as extern.
If they are different, but you can't change them to static then you can hide them doing a
ld -r filex.o -h x -h y -o filex2.o
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