Get location of libasan from gcc/clang
When I compile with -fsanitize=address, GCC/Clang implicitly make use of an ASAN dynamic library which provides runtime support for ASAN. If your built library is dynamically loaded by another...
View ArticleCompiling C code using Intel MKL: ld: unknown option: --no-as-needed
I wrote a C file (template.c) that uses the MKL Intel library (which I've already installed). I'm using this shell script to compile my code (template.c). Assume the C file is minimal - it imports the...
View Articlegcc-arm-linux-gnueabi command not found
I am trying to install the gnu arm toolchain for ubuntu. I first downloaded the tar from CodeSourcery. However when I go into the bin folder, I cannot run any of the binaries. I have tried with ./ and...
View ArticleHow to correctly compile uClibc++ with musl?
I need to compile c++ code with uClibc++ and musl. To do that, first I must compile uClibc++ agains musl. But trying to do so, I have run to a few errors, like missing __snprintf_chk and...
View ArticleLibsodium on macOS, undefined symbols for x86_64
I'm using an Intel Mac running Catalina 10.15.1I'm trying to use libsodium using gcc Apple clang version 11.0.0 (clang-1100.0.33.12)I have both tried to install libsodium via home-brew and manually...
View ArticleWhy the compiler flags “-mcpu=cortex-m3” goes wrong with stm32f10x?
core of stm32f10x should be cortex-m3,with the flag"-mcpu=cortex-m3"↓(this is section of makefile ):CFLAGS +=...
View Articlewhat to configure for running threads in eclipse
i know it is a well known problem.i have a simple thread c++ code:#include <string> #include <iostream> #include <thread> using namespace std; // The function we want to execute on...
View ArticleGcc collect2: fatal error: cannot find 'ld'
I'm going through the tutorial on making an OS on http://wiki.osdev.org/Bare_Bones. When I try to link boot.o and kernel.o using this command: i686-elf-gcc -T linker.ld -o myos.bin -ffreestanding -O2...
View Articleint main = 0, is compiled but crashed
I had very simple program as below. int main = 0;This program as a.c file compiled fine with gcc-4.8,gcc-5,gcc-6,gcc-7 and gcc-8 and application crashed when executed. Same program as a.cpp file...
View ArticleMystery: casting a GNU C label pointer to a function pointer, with inline asm...
Firstly: This code is considered to be of pure fun, please do not do anything like this in production. We will not be responsible of any harm caused to you, your company or your reindeer after...
View ArticleDoes MinGW-w64 support std::thread out of the box when using the Win32...
I have opted for the Win32 threading model when installing the MinGW-w64 toolchain, after reading that it provides better performance than the POSIX counterpart. I am not qualified for benchmarking...
View ArticleWhy do I get a linker error while I try to compile a C file?
I've had this error for weeks I already made a post about it but it wasn't very clear. So I am calling a function from a a header file myBmpGris.h and the functions are implemented on the file...
View ArticleGCC 7, -Wimplicit-fallthrough warnings, and portable way to clear them?
We are catching warnings from GCC 7 for implicit fall through in a switch statement. Previously, we cleared them under Clang (that's the reason for the comment seen below):g++ -DNDEBUG -g2 -O3...
View ArticleAlternative to sscanf that makes both Linux and Windows happy
I have a truly ancient punch-card format and a C++ code that reads it using sscanf as follows, sscanf(longstr1,"%2d %5ld %1c %10s %2d %12lf %11lf %7lf %2d %7lf %2d %2d %6ld ",...
View Articleerror in compiling: undefined reference to 'nameOfFunction'
I have a project in c and I cannot compile it because of errors. I use CLion editor and compile it there(using the play button). I get the following error: CMakeFiles/GameServer.dir/game.c.o: In...
View ArticleUsing MinGW gcc to create DLLs for VBA 64 bit
I want to do what the title says. This has been discussed before (How to create dll using gcc compiler/Mingw for visual basic?), but these posts are 10 years old. I was writing Excel/VBA macros at that...
View ArticleCompile error while try install mysqlclient package with pip
I have CentOS 7 with installed mariadb, python3.6 and pip for python3.6 I also installed glibc-static and libstdc++-staticI try to install mysqlclient with "pip install mysqlclient"I have this error in...
View ArticleI cannot link with gcc-7
I have 3 files: tester.c, knnring_sequential.c, knnring.h.I compile them with the sequence:gcc-7 -c knnring_sequential.c -o knnring_sequential.o ar rcs knnring_sequential.a knnring_sequential.o gcc-7...
View ArticleWhy does STL function use node's color to calculate std::map node predecessor
I was looking through libstdc++'s implementation of std::map and noticed that iterator increment and decrement functions are not entirely symmetrical. local_Rb_tree_decrement function (aka predecessor)...
View ArticleA int[2²⁰] array cause OpenMP Segmentation Fault
I have an int flags[(1<<20)]; array and it seems that there's something wrong, and it causes segmentation fault. Is this a stack overflow problem? How much should I set stack size and how?
View Article