Raised This Month: $7 Target: $400
 1% 

Version `GLIBCXX_3.4.21' not found


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kadet.89
Veteran Member
Join Date: Nov 2012
Location: Serbia
Old 07-17-2016 , 07:03   Version `GLIBCXX_3.4.21' not found
Reply With Quote #1

If system upgrade and recompilling extensions, I get this error:
Code:
[SM] Extension test.ext.so failed to load: bin/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /home/Public/cstrike/addons/sourcemod/extensions/test.ext.2.css.so)
Though the system has this version of the library. The server seems to use it's own obsolete version of libstdc++.so.6, what can I do about it?

Last edited by kadet.89; 07-17-2016 at 07:25.
kadet.89 is offline
Send a message via Skype™ to kadet.89
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 07-17-2016 , 07:27   Re: Version `GLIBCXX_3.4.21' not found
Reply With Quote #2

Update your libstdc++6 on the server? What OS is your server running on? Is it a hosted server or you own? Do you have the command line access?
klippy is offline
kadet.89
Veteran Member
Join Date: Nov 2012
Location: Serbia
Old 07-17-2016 , 07:33   Re: Version `GLIBCXX_3.4.21' not found
Reply With Quote #3

Yes, it's VDS ubuntu 16.04, root access. The systems library is updated, but I have no idea how to update the servers library, if I replace the file manually, the server wont start.

How can I set this option: -static-libstdc++ ?,I guess it can solve my problem.

Last edited by kadet.89; 07-17-2016 at 08:07.
kadet.89 is offline
Send a message via Skype™ to kadet.89
waggel
Junior Member
Join Date: Aug 2007
Old 07-19-2016 , 20:28   Re: Version `GLIBCXX_3.4.21' not found
Reply With Quote #4

You can set them as gcc/g++ compiler flags (static linking of libstdc will make your binaries quite big)
waggel is offline
kadet.89
Veteran Member
Join Date: Nov 2012
Location: Serbia
Old 07-27-2017 , 04:51   Re: Version `GLIBCXX_3.4.21' not found
Reply With Quote #5

I got back to this problem, want to get rid of static linking. What are the flags you were talking about, can you give me an example how to set them

Last edited by kadet.89; 07-27-2017 at 04:51.
kadet.89 is offline
Send a message via Skype™ to kadet.89
blacklagoon
Senior Member
Join Date: Jun 2012
Old 07-27-2017 , 12:44   Re: Version `GLIBCXX_3.4.21' not found
Reply With Quote #6

here's an example for ambuild:


Code:
 def configure_linux(self, cxx):
    cxx.defines += ['_LINUX', 'POSIX', '_FILE_OFFSET_BITS=64']
    cxx.linkflags += ['-Wl,--exclude-libs,ALL', '-lm']
    if cxx.vendor == 'gcc':
      cxx.linkflags += ['-static-libgcc']
    elif cxx.vendor == 'clang':
      cxx.linkflags += ['-lgcc_eh']
    cxx.linkflags += ['-static-libstdc++']
blacklagoon is offline
kadet.89
Veteran Member
Join Date: Nov 2012
Location: Serbia
Old 07-28-2017 , 07:12   Re: Version `GLIBCXX_3.4.21' not found
Reply With Quote #7

Thanks for your example. "cxx.linkflags += ['-static-libstdc++']" is what I'm using now, it's static linking. If I remove this flag, my extensions become quite small, but I get this error:
Code:
[13] <FAILED> file "extension.ext.2.css.so": bin/libstdc++.so.6: version `GLIBCXX_3.4.18' not found (required by /home/server/cstrike/addons/sourcemod/extensions/extension.ext.2.css.so)
is there a way to avoid this error?

When I run:
> strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBC
I get this:
Code:
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.16
GLIBCXX_3.4.17
GLIBCXX_3.4.18
GLIBCXX_3.4.19
GLIBCXX_3.4.20
GLIBCXX_3.4.21
GLIBC_2.3
GLIBC_2.2.5
GLIBC_2.14
GLIBC_2.4
GLIBC_2.18
GLIBC_2.3.4
GLIBC_2.17
GLIBC_2.3.2
GLIBCXX_DEBUG_MESSAGE_LENGTH

But if I run this:
> strings /home/server/bin/libstdc++.so.6 | grep GLIBC
I get another list:
Code:
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.16
GLIBC_2.0
GLIBC_2.3
GLIBC_2.1
GLIBC_2.1.3
GLIBC_2.3.2
GLIBC_2.2
GLIBCXX_FORCE_NEW
GLIBCXX_DEBUG_MESSAGE_LENGTH
UPD

I removed /home/server/bin/libstdc++.so.6 and now it works fine, but something tells me it's no good

Last edited by kadet.89; 07-28-2017 at 09:05.
kadet.89 is offline
Send a message via Skype™ to kadet.89
Fyren
FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
Join Date: Feb 2106
Old 07-28-2017 , 16:50   Re: Version `GLIBCXX_3.4.21' not found
Reply With Quote #8

It should be fine to use a newer libstdc++. I think the only potential issue there is gcc >=5.1's libstdc++ and its ABI change with std::string, but there's a define you can set to pick the ABI.

If you really care, you will probably have to set up a separate build environment with an older gcc/libstdc++. If your distro has an alternatives-like system, that should be easy. I guess you could set up a chroot manually worst case.
Fyren is offline
DJ Tsunami
DJ Post Spammer
Join Date: Feb 2008
Location: The Netherlands
Old 07-29-2017 , 03:11   Re: Version `GLIBCXX_3.4.21' not found
Reply With Quote #9

I had the same error when using std::string on Ubuntu 16.04, and I didn't know about the _GLIBCXX_USE_CXX11_ABI define, so I switched to ke::AString from AMTL.
__________________
Advertisements | REST in Pawn - HTTP client for JSON REST APIs
Please do not PM me with questions. Post in the plugin thread.
DJ Tsunami is offline
Fyren
FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
Join Date: Feb 2106
Old 07-29-2017 , 05:31   Re: Version `GLIBCXX_3.4.21' not found
Reply With Quote #10

The define will deal with ABI issues where you need to interact with existing code using the old ABI, but that's separate from linking issues where it expects newer-versioned symbols.
Fyren is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:50.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode