linking error in compiling with mingw64

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

Post Reply
Yr9
Engineer
Engineer
Posts: 1
Joined: 29 Nov 2019 10:52

linking error in compiling with mingw64

Post by Yr9 » 29 Nov 2019 11:04

Hello guys.

My computer's OS is windows 10, I installed msys2-x86_64-20190524.exe, downloaded openttd-1.9.3 source, compile, but it shows " undefined reference to `__memcpy_chk' "

I'm not familiar with C++, I have searched for this linking error, try to fixed it, but I failed.

Here is my compile log:

Code: Select all

Think@STD MINGW64 ~/openttd-1.9.3
$ ./configure
checking awk... awk
detecting OS... MINGW
checking build system type... x86_64-w64-mingw32
checking host system type... x86_64-w64-mingw32
checking universal build... no
checking build cc... gcc
checking host cc... gcc
checking build c++... g++
checking host c++... g++
checking host windres... windres
checking host strip... strip
checking builtin depend... yes
checking makedepend... disabled
detecting cpu-type... 64 bits
detecting SSE... found
checking static... yes
checking unicode... yes
using debug level... no
using desync debug level... no
using link time optimization... no
checking OSX sysroot... not OSX, skipping
checking allegro... not found
checking sdl... not found
checking COCOA... not OSX, skipping
checking GDI video driver... found
checking dedicated... not selected
checking console application... disabled (only used when forced)
checking network... found
checking squirrel... found
checking translator... no
checking assert... disabled
checking zlib... found
checking liblzma... found
checking lzo2... found
checking Uniscribe text layout... found
checking libxdg-basedir... not found
checking libpng... found
checking freetype2... found
checking libfontconfig... WIN32, skipping
checking icu-lx... disabled
checking icu-i18n... disabled
checking libtimidity... not found
checking fluidsynth... not found
checking direct-music... found
checking xaudio2... not found
checking sort... sort
suppress language errors... no
checking stripping... strip -s
checking distcc... no (only used when forced)
checking ccache... no (only used when forced)
checking grfcodec... not found
checking nforenum... not found
checking OSX application bundle... not OSX, skipping
checking revision... source tarball
checking iconv... not OSX, skipping
personal home directory... OpenTTD
shared data directory... none
installation directory... /
icon theme directory... none
manual page directory... none
menu item directory... none
using CFLAGS_BUILD...  -Wall -Wno-multichar -Wsign-compare -Wundef -Wwrite-strings -Wpointer-arith -W -Wno-unused-parameter -Wredundant-decls -Wformat=2 -Wformat-security -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-but-set-parameter -Winit-self -fno-strict-aliasing -Wcast-qual -fno-strict-overflow -Wnon-virtual-dtor -Wno-free-nonheap-object -DMINGW -D_FORTIFY_SOURCE=2 -O1 -DNDEBUG
using CXXFLAGS_BUILD...  -flifetime-dse=1 -std=c++11
using LDFLAGS_BUILD...  -static-libgcc -static-libstdc++
using CFLAGS... -O2 -fomit-frame-pointer  -Wall -Wno-multichar -Wsign-compare -Wundef -Wwrite-strings -Wpointer-arith -W -Wno-unused-parameter -Wredundant-decls -Wformat=2 -Wformat-security -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-but-set-parameter -Winit-self -fno-strict-aliasing -Wcast-qual -fno-strict-overflow -Wnon-virtual-dtor -Wno-free-nonheap-object -DMINGW -D_FORTIFY_SOURCE=2 -DWITH_SSE -mno-ms-bitfields -DWIN -DWITH_ZLIB -ID:/msys64/mingw64/include   -DWITH_LZMA -ID:/msys64/mingw64/include   -DLZMA_API_STATIC -DWITH_LZO -D_SQ64 -ID:/msys64/home/Think/openttd-1.9.3/src/3rdparty/squirrel/include -DWITH_PNG -ID:/msys64/mingw64/include/libpng16 -ID:/msys64/mingw64/include   -DWITH_FREETYPE -mms-bitfields -ID:/msys64/mingw64/include/freetype2 -ID:/msys64/mingw64/include -ID:/msys64/mingw64/include/libpng16 -ID:/msys64/mingw64/include -ID:/msys64/mingw64/include/harfbuzz -ID:/msys64/mingw64/include/glib-2.0 -ID:/msys64/mingw64/lib/glib-2.0/include -ID:/msys64/mingw64/include   -DWITH_UNISCRIBE -DWIN32_ENABLE_DIRECTMUSIC_SUPPORT -Wno-non-virtual-dtor -DUNICODE -D_UNICODE -DENABLE_NETWORK -DNDEBUG -DWITH_PERSONAL_DIR -DPERSONAL_DIR=\\"OpenTTD\\" -DGLOBAL_DATA_DIR=\\"/usr/local/share/games/openttd\\"
using CXXFLAGS...  -flifetime-dse=1 -std=c++11
using LDFLAGS...  -lws2_32 -lwinmm -lgdi32 -ldxguid -lole32 -limm32 -LD:/msys64/mingw64/lib -lz   -LD:/msys64/mingw64/lib -llzma   /mingw64/lib/liblzo2.a -LD:/msys64/mingw64/lib -lpng16 -lz   -LD:/msys64/mingw64/lib -lfreetype -lbz2 -lpng16 -lz -lharfbuzz -lm -lusp10 -lgdi32 -lrpcrt4 -lglib-2.0 -lintl -lws2_32 -lole32 -lwinmm -lshlwapi -pthread -lm -lpcre -lgraphite2   -lfreetype -lusp10  -Wl,--subsystem,windows -static
Generating Makefile...
Generating lang/Makefile...
Generating setting/Makefile...
Generating grf/Makefile...
Generating objs/Makefile...

Think@STD MINGW64 ~/openttd-1.9.3
$ make
make[1]: Entering directory '/home/Think/openttd-1.9.3/objs/lang'
[LANG] Compiling core/alloc_func.cpp
[LANG] Compiling string.cpp
[LANG] Compiling strgen/strgen_base.cpp
[LANG] Compiling strgen/strgen.cpp
[LANG] Compiling getoptdata.cpp
[LANG] Compiling and Linking strgen.exe
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: strgen_base.o:strgen_base.cpp:(.text+0x28e): undefined reference to `__memcpy_chk'
collect2.exe: error: ld returned 1 exit status
make[1]: *** [Makefile:67: strgen.exe] Error 1
make[1]: Leaving directory '/home/Think/openttd-1.9.3/objs/lang'
make: *** [Makefile:56: all] Error 1
Does anyone have the same error? Or could someone give me some technical hint?

User avatar
orudge
Administrator
Administrator
Posts: 24042
Joined: 26 Jan 2001 20:18
Skype: orudge
Location: Banchory, UK
Contact:

Re: linking error in compiling with mingw64

Post by orudge » 04 Dec 2019 13:49

This seems to be an issue with mingw-w64 - this case has more details.

Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 1 guest