Jump to content
  • 0

Updating to MySQL5.7


3bd0
Go to solution Solved by SergiuAndreiM,

Question

Posted (edited)

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 [email protected]

$(OBJDIR)/version.o: version.cpp
	@$(CC) $(CFLAGS) -D__P4_VERSION__=\"$(SVN_VERSION)\" -c $< -o [email protected]
	@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 (see edit history)
Link to post

2 answers to this question

Recommended Posts

  • 0
  • 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

https://github.com/blackdragonx61/Metin2-Update-C-Status?fbclid=IwAR32JD2ojmFhFUR4cuD4hwhBBz-Y3__KsDfSKFwQ81dqrJVEteaVSrcwWPg\

upgrade your source.

don't forget to make some backups.

  • Love 1
Link to post
  • 0

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

Link to post
Guest
This topic is now closed to further replies.


×
×
  • 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.