Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

160
Views
GCC link error "__wcsrtombs: Zusicherung »data.__outbuf[-1] == '\0'« nicht erfüllt"

Based on this question i get error message...

collect2: fatal error: ld terminated with signal 6 [Abgebrochen]
compilation terminated.
/usr/bin/ld: ld: wcsrtombs.c:99: __wcsrtombs: Zusicherung »data.__outbuf[-1] == '\0'« nicht erfüllt.

...when trying to link a shared library but setting LC_ALL=C doesn't solve the problem in my case!

I'm on a german Linux Mint 17.3 (Cinnamon). My project gets build with CMake 2.8.4 (native repository). Compiler is g++ 5.3.1 (Ubuntu xenial repository).

Compile command for all sources looks like this:

/usr/bin/c++   -D_USE_MATH_DEFINES -Dfluag_EXPORTS -g -fPIC -I/home/youka/Schreibtisch/Projekte/FLuaG/build/src -I/usr/include/luajit-2.0 -I/usr/local/include    -Wall -Wextra -pedantic -Wredundant-decls -Wunreachable-code -Wmissing-include-dirs -Wswitch-enum -Wno-missing-field-initializers -std=c++11 -mmmx -o CMakeFiles/fluag.dir/main/FLuaG.cpp.o -c /home/youka/Schreibtisch/Projekte/FLuaG/src/main/FLuaG.cpp

Link command which causes error:

/usr/bin/c++  -fPIC -g   -shared -Wl,-soname,libfluag.so -o libfluag.so CMakeFiles/fluag.dir/lualibs/utf8.cpp.o CMakeFiles/fluag.dir/lualibs/mathx.cpp.o CMakeFiles/fluag.dir/lualibs/regex.cpp.o CMakeFiles/fluag.dir/lualibs/png.cpp.o CMakeFiles/fluag.dir/lualibs/geometry.cpp.o CMakeFiles/fluag.dir/lualibs/tablex.cpp.o CMakeFiles/fluag.dir/lualibs/filesystem.cpp.o CMakeFiles/fluag.dir/lualibs/tgl.cpp.o CMakeFiles/fluag.dir/lualibs/font.cpp.o CMakeFiles/fluag.dir/interfaces/vapoursynth.cpp.o CMakeFiles/fluag.dir/interfaces/public.cpp.o CMakeFiles/fluag.dir/main/FLuaG_image.cpp.o CMakeFiles/fluag.dir/main/FLuaG.cpp.o -Wl,-Bstatic -lluajit-5.1 -Wl,-Bdynamic -lGLEW /usr/local/lib/libglfw3.a -lGL -lpng -lz

Compiling this project with MinGW64 on Windows Vista works. Release or Debug build, with or without SIMD, etc. makes no difference.

The error message tells me that in file wcsrtombs.c (linked libgcc), line 99, memory comparison data.__outbuf[-1] == '\0' isn't ensured... which pretty confuses me.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

After setting the system language to english, the error message suddenly made sense:

/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libluajit-5.1.a(ljamalg.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libluajit-5.1.a: error adding symbols: Bad value

The problem was -Wl,-Bstatic -lluajit-5.1. I linked to the .a file which was expected to be a static library by CMake. Changing to .so solved the problem.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!