Jump to content

Updating to MySQL5.7


Go to solution Solved by HaiosMotan,

Recommended Posts

Hi,

 

I am updating my MySQL version to 5.7. I removed old mysql and installed the new version, then tried to recompile dp and game with the new libraries. I get some weird linker issues, tried to work it out but no luck. The output is:

/usr/local/bin/ld: /usr/local/lib/mysql/libmysqlclient.a(sha2_password_common.cc.o): in function `sha2_password::Generate_scramble::Generate_scramble(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, sha2_password::Digest_info)':
sha2_password_common.cc:(.text+0x30e): undefined reference to `std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::basic_string(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)'
/usr/local/bin/ld: sha2_password_common.cc:(.text+0x31e): undefined reference to `std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::basic_string(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)'
/usr/local/bin/ld: /usr/local/lib/mysql/libmysqlclient.a(sha2_password_common.cc.o): in function `generate_sha256_scramble':
sha2_password_common.cc:(.text+0x72b): undefined reference to `std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::basic_string(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)'
/usr/local/bin/ld: sha2_password_common.cc:(.text+0x73d): undefined reference to `std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::basic_string(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)'
/usr/local/bin/ld: sha2_password_common.cc:(.text+0x833): undefined reference to `std::__1::__basic_string_common<true>::__throw_length_error() const'
/usr/local/bin/ld: sha2_password_common.cc:(.text+0x83d): undefined reference to `std::__1::__basic_string_common<true>::__throw_length_error() const'
collect2: error: ld returned 1 exit status
gmake: *** [Makefile:82: ../db_r] Error 1

And this is my make file:

Spoiler

MAKE = gmake
CC = g++48

INCDIR =
LIBDIR =
BINDIR = ..
OBJDIR = .obj

P4_VERSION = 1337
SVN_VERSION = 1337

GCC_VERSION = $(shell $(CC) --version 2>&1 | grep "(GCC)" | cut -d' ' -f3  | cut -d'.' -f1)
BSD_VERSION = $(shell uname -v 2>&1 | cut -d' ' -f2 | cut -d'.' -f1)
P4_VERSION = $(shell p4 changes -m1 $(PWD)/...\#have | cut -d' ' -f2)
$(shell if [ ! -d $(OBJDIR) ]; then mkdir $(OBJDIR); fi)

TARGET = $(BINDIR)/db_r

# Standard Libs
LIBS = -lm -lmd

CFLAGS = -g3 -ggdb -Wall -O2 -static -std=c++11 -pipe -fno-strict-aliasing -fexceptions -pthread -D_THREAD_SAFE -D__SVN_VERSION__=\"$(SVN_VERSION)\"

ifeq ($(GCC_VERSION), 4)
CFLAGS += -mtune=i686
else
CFLAGS += -march=i686
endif

# boost
INCDIR += -I../../../Extern/include/boost

# DevIL
INCDIR += -I../../../Extern/include/IL
LIBS += ../../../Extern/lib/libIL.a\
		../../../Extern/lib/libjasper.a\
		../../../Extern/lib/libpng.a\
		../../../Extern/lib/libtiff.a\
		../../../Extern/lib/libjbig.a\
		../../../Extern/lib/libmng.a\
		../../../Extern/lib/liblzma.a\
		../../../Extern/lib/liblcms.a\
		../../../Extern/lib/libjpeg.a

# MySQL
INCDIR += -I/usr/local/include/mysql
LIBS += /usr/local/lib/mysql/libmysqlclient.a\
		/usr/lib/libz.a

# CryptoPP
LIBS += ../../../Extern/lib/libcryptopp.a

# OpenSSL
INCDIR += -I/usr/include
LIBS += -lssl -lcrypto

# Project Libraries
INCDIR += -I../../../Extern/include
INCDIR += -I/usr/local/include
LIBDIR += -L/usr/local/lib

# Extern
INCDIR += -I../../../Extern/include

INCDIR += -I../../libserverkey
LIBDIR += -L../../libthecore/lib -L../../libpoly -L../../libsql -L../../libgame/lib -L../../libserverkey
LIBS += -lthecore -lpoly -lsql -lgame -lserverkey

SRCS =	Config.cpp NetBase.cpp Peer.cpp PeerBase.cpp Main.cpp Lock.cpp DBManager.cpp \
		Cache.cpp LoginData.cpp ClientManager.cpp ClientManagerPlayer.cpp ClientManagerLogin.cpp \
		ClientManagerBoot.cpp ClientManagerParty.cpp ClientManagerGuild.cpp GuildManager.cpp HB.cpp \
		PrivManager.cpp MoneyLog.cpp ItemAwardManager.cpp ClientManagerEventFlag.cpp Marriage.cpp \
		Monarch.cpp BlockCountry.cpp ItemIDRangeManager.cpp ClientManagerHorseName.cpp version.cpp \
		AuctionManager.cpp ProtoReader.cpp CsvReader.cpp 

OBJS = $(SRCS:%.cpp=$(OBJDIR)/%.o)

default: $(TARGET)

$(TARGET): $(OBJS)
	@echo linking ...
	@$(CC) $(CFLAGS) $(LIBDIR) $(OBJS) $(LIBS) -o $(TARGET)
	@touch version.cpp

$(OBJDIR)/%.o: %.cpp
	@echo compile $<
	@$(CC) $(CFLAGS) $(INCDIR) -c $< -o $@

$(OBJDIR)/version.o: version.cpp
	@$(CC) $(CFLAGS) -D__P4_VERSION__=\"$(SVN_VERSION)\" -c $< -o $@
	@echo compile $<

$(OBJDIR):
	@mkdir $(OBJDIR)

clean:
	@rm -f $(OBJS) $(BINDIR)/db_r

dep:
	@touch Depend
	makedepend -fDepend $(INCDIR) -I/usr/include/c++/3.3 -I/usr/include/c++/4.2 -p$(OBJDIR)/ $(SRCS) 2> /dev/null

sinclude Depend

 

 

 

Thanks.

Edited by 3bd0
Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

  • Solution
3 hours ago, 3bd0 said:

It looks like mysql 5.7 is compiled with clang, while I compile my sources with g++. Is there any way to make mysql compile with gcc? I have version 4.8 installed

This is the hidden content, please
\

upgrade your source.

don't forget to make some backups.

  • Metin2 Dev 85
  • Dislove 1
  • Lmao 1
  • Good 29
  • Love 2
  • Love 19
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.