- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Global variables are not initialized in shared lib...
Categories
Company
Local Language
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
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
Community
Resources
Forums
Blogs
- 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
09-17-2003 02:28 AM
09-17-2003 02:28 AM
Global variables are not initialized in shared libraries
I have built a shared library with several global variables. Their constructors are not called when the library is loaded. Where the problem may be? The same code work perfectly on Linux.
Compiler is GCC 3.2.2. Linker command line options are "g++ -Wl,s -fPIC -shared -Wl,-b ...".
Thanks in advance for any help...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2003 05:06 AM
09-17-2003 05:06 AM
Re: Global variables are not initialized in shared libraries
whats -Wl,s ? i guess you meant -Wl,+s or -Wl,-s.
--
ranga
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2003 05:17 AM
09-17-2003 05:17 AM
Re: Global variables are not initialized in shared libraries
Reading specs from /usr/local/lib/gcc-lib/hppa2.0w-hp-hpux11.00/3.2.2/specs
Configured with: ./configure : (reconfigured) ./configure : (reconfigured) ./configure --enable-threads=posix : (reconfigured) ./configure --enable-threads=posix : (reconfigured) ./configure --with-gnu-as --enable-threads=posix : (reconfigured) ./configure --with-gnu-as --enable-threads=posix : (reconfigured) ./configure --with-gnu-as --enable-threads=posix --enable-shared : (reconfigured) ./configure --with-gnu-as --enable-threads=pthreads --enable-shared : (reconfigured) ./configure --with-gnu-as --enable-threads=posix --enable-shared : (reconfigured) ./configure --with-gnu-as --enable-threads=posix : (reconfigured) ./configure --with-gnu-as --enable-threads=posix : (reconfigured) ./configure --with-gnu-as --enable-threads=posix : (reconfigured) ./configure : (reconfigured) ./configure --with-gnu-as --enable-threads=posix
Thread model: posix
gcc version 3.2.2
/usr/local/lib/gcc-lib/hppa2.0w-hp-hpux11.00/3.2.2/collect2 -z -b -o lib.so.0.1.0 -L/usr/local/lib/gcc-lib/hppa2.0w-hp-hpux11.00/3.2.2 -L/usr/ccs/bin -L/usr/ccs/lib -L/usr/local/lib/gcc-lib/hppa2.0w-hp-hpux11.00/3.2.2/../../.. -s -b +h lib.so.0.1 obj.o -lpthread -lstdc++ -lm -lgcc_s -lgcc_s
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2003 03:55 PM
09-22-2003 03:55 PM
Re: Global variables are not initialized in shared libraries
by the way, what makes you choose hppa2.0w over hppa2.0n, since both build only 32bit objects?
--
ranga
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2003 06:31 PM
09-22-2003 06:31 PM
Re: Global variables are not initialized in shared libraries
And what will be the difference between them?