- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- ld: Duplicate symbol "WaitMutex" in files Main_Pro...
Operating System - Linux
1748136
Members
3650
Online
108758
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
Discussions
Discussions
Forums
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
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
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
тАО07-06-2007 12:42 AM
тАО07-06-2007 12:42 AM
this the libcommon.h
#ifndef __COMMON_H
#define __COMMON_H
#pragma once
#define SEM_MUTEX 0
#define SEM_EMPTY 1
#define SEM_FULL 2
struct sembuf WaitMutex={SEM_MUTEX, -1, 0};
class common
{
public:
common();
~common(void);
};
#endif
this class is using the library :
#ifndef __MODELO_H
#define __MODELO_H
#include "libcommon.h"
using namespace oracle::occi;
using namespace std;
class Modelo
{
public:
Modelo();
~Modelo(void);
};
#endif
i am going to show you the Makefile
ICLIBPATH=-L$(ICLIBHOME)
THREADLIBS=
CCLIB=$(ICLIBPATH) -locci -lclntsh -lgen $(THREADLIBS)
all: exe
# Cleanup the current directory: (make clean)
#
clean:
rm -f *.o
# Include the Oracle compiler settings. Typically overkill, but
# platform-independent.
#
include /opt/users/ora10g/rdbms/lib/env_rdbms.mk
libcommon.o: libcommon.cc libcommon.h
$(CCC) -Aa -c +z libcommon.cc
library:libcommon.o
ld -b -o libcommon.so libcommon.o
Modelo.o: Modelo.cc Modelo.h
$(CCC) $(CFLAGSCC) -c Modelo.cc
Main_Program.o: Main_Program.cc Modelo.h
$(CCC) $(CFLAGSCC) -c Main_Program.cc
exe:libcommon.o library Modelo.o Main_Program.o
$(CCC) -o $(EXE) Main_Program.o Modelo.o $(ICLIBPATH) $(SHARED_OCCILIBS) -L. -lcommon
this the i have trying to link:
[]-pedro:/home/pedro/MIR-PRUEBAS/modelo_SP_teste>make
/opt/aCC/bin/aCC +DD64 -Aa -c +z libcommon.cc
ld -b -o libcommon.so libcommon.o
/opt/aCC/bin/aCC +DD64 -AA -DOCCI_NO_WSTRING=1 +DD64 -D_RWSTD_MULTI_THREAD -I/opt/users/ora10g/rdbms/demo -I/opt/users/ora10g/rdbms/public -I/opt/users/ora10g/plsql/public -I/opt/users/ora10g/network/public -DHPUX -D_REENTRANT -DHPUX_KTHREAD -DSLXMX_ENABLE -DSLTS_ENABLE -DSS_64BIT_SERVER -DBIT64 -DMACHINE64 -DORAIA64 -DHPUX_IA64 -c Modelo.cc
/opt/aCC/bin/aCC +DD64 -AA -DOCCI_NO_WSTRING=1 +DD64 -D_RWSTD_MULTI_THREAD -I/opt/users/ora10g/rdbms/demo -I/opt/users/ora10g/rdbms/public -I/opt/users/ora10g/plsql/public -I/opt/users/ora10g/network/public -DHPUX -D_REENTRANT -DHPUX_KTHREAD -DSLXMX_ENABLE -DSLTS_ENABLE -DSS_64BIT_SERVER -DBIT64 -DMACHINE64 -DORAIA64 -DHPUX_IA64 -c Main_Program.cc
/opt/aCC/bin/aCC +DD64 -o occiteste Main_Program.o Modelo.o -L/opt/users/ora10g/lib -locci -lclntsh `cat /opt/users/ora10g/lib/sysliblist` -lm -L. -lcommon
ld: Duplicate symbol "WaitMutex" in files Main_Program.o and Modelo.o
ld: Duplicate symbol "SignalMutex" in files Main_Program.o and Modelo.o
ld: Duplicate symbol "WaitEmpty" in files Main_Program.o and Modelo.o
ld: Duplicate symbol "SignalEmpty" in files Main_Program.o and Modelo.o
ld: Duplicate symbol "WaitFull" in files Main_Program.o and Modelo.o
ld: Duplicate symbol "SignalFull" in files Main_Program.o and Modelo.o
6 errors.
make: *** [exe] Error 1
[]-pedro:/home/pedro/MIR-PRUEBAS/modelo_SP_teste>
thanks
SLB SLB SLB Glorioso
Solved! Go to Solution.
- Tags:
- duplicate
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-06-2007 03:35 PM
тАО07-06-2007 03:35 PM
Solution
struct sembuf WaitMutex={SEM_MUTEX, -1, 0};
You can't put definitions of global data in header files. You'll get duplicates exactly like this.
The correct way to do this is with extern declaration in the header and with one source with the definition.
(You can of course do this with templates and template class static data members.)
>ld -b -o libcommon.so libcommon.o
It is illegal to use ld directly to build shared libs. Use aCC -b instead.
>-D_RWSTD_MULTI_THREAD
You should be compiling with -mt to set all of the correct threading defines.
You can't put definitions of global data in header files. You'll get duplicates exactly like this.
The correct way to do this is with extern declaration in the header and with one source with the definition.
(You can of course do this with templates and template class static data members.)
>ld -b -o libcommon.so libcommon.o
It is illegal to use ld directly to build shared libs. Use aCC -b instead.
>-D_RWSTD_MULTI_THREAD
You should be compiling with -mt to set all of the correct threading defines.
- Tags:
- -mt
- SHLIB_PATH
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-09-2007 11:28 PM
тАО07-09-2007 11:28 PM
Re: ld: Duplicate symbol "WaitMutex" in files Main_Program.o and Modelo.o
it is working now i just moved the declarations to the .cc .
thanks
thanks
SLB SLB SLB Glorioso
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.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP