Quantcast
Browsing all 22144 articles
Browse latest View live

Relocation R_X86_64_32 against `.rodata' can not be used when making a shared...

I am trying staticaly link dmtx library into shared library (.so) which should be called then using JNI on Ubuntu 16 (64 bit)I got weird error:Relocation R_X86_64_32 against `.rodata' can not be used...

View Article


include binary data files into compiled binary without converting to hex...

This question already has an answer here:Embedding resources in executable using GCC 4 answersI regularly want to include (compile in) binary data from external files as an uint8_t array into my...

View Article


How to get rid of automatically added library provided by GCC?

I'm compiling main.c file by gcc with enabled sanitizer option.As a result, linker command contains "-lubsan" option in its arguments list.Need to say, that I haven't provided "-lubsan" option to gcc...

View Article

gcc throwing error while compiling the code having GObject related libraraies...

Have a simple C program using glib library for referencing and dereferencing GObject. I wrote the code on ubuntu and have installed glib library on it. Running the command gcc *.c `pkg-config --cflags...

View Article

How to solve the g++ problem "internal compiler error: Illegal instruction...

On Ubuntu, gcc 8.3.0,I compile test.cpp file:#include<algorithm> int main(){} g++ -o test test.cpp and get the following compile errorIn file included from...

View Article


Can we specify lib file path with non initiated variable in gcc in run time

The question is we want to specify lib path in variable which fill after complie, there fore we don't like any hard code in binary file about library path. Is it possible?

View Article

Partial preprocessing of C files with GCC (not removing "define" directives)

GCC can output a fully preprocessed C++ source file if I pass the -E or -save-temps command line argument.My question is, can I somehow get a partially preprocessed C++ source file in which a) code...

View Article

Math library linking error in CLion on Linux [duplicate]

This question already has an answer here:How to link to the C math library with CMake? 1 answerTo do my homework I need #include "math.h", but after updating GCC and CMake, CLion can't link my project...

View Article


OSX Catalina GCC/PIP Issue

I'm trying to install a tool through pip3 onto my Mac but I get the following error: compilation terminated. error: command 'gcc' failed with exit status 1**I've noticed that others have this issue...

View Article


address-of-packed-member: Disable for specific function?

I've noticed this error raises every time I'm accessing member of packed structHow can I disable it specifically for functions that handle the misalignment? (safe_unaligned_val_16/32/64 - constructs...

View Article

OpenMP parralel program of Fibonacci is slower than sequential

I have this sequential code:int fib(int n) { int x, y; if (n < 2) return n; x = fib(n-1); y = fib(n-2); return x + y; } And this parallel code:int fib(int n) { int x, y; if (n < 2) return n;...

View Article

What is the difference between gcc -ggdb and gcc -g

When I use gcc to compile C programs I usually use -g to get some debug information into the elf file so that gdb can help me if needed.However, I noticed that some programs use -ggdb, since it's...

View Article

In Makefiles, how to display percentage of compilation followed by compiler's...

This is a bit tricky...I want my Makefile to display progression percentage of my compilation. This is easy as long as I use tput or escaped sequences to move my cursor to modify my percentage.But if a...

View Article


Link libquadmath with c++ on linux

I have an example code:#include <quadmath.h> int main() { __float128 foo=123; cosq(foo); return 0; } I tried to compile it with the following commands:g++ f128.cpp -lquadmath g++ f128.cpp...

View Article

OpenMP parallel program of Fibonacci is slower than sequential

I have this sequential code:int fib(int n) { int x, y; if (n < 2) return n; x = fib(n-1); y = fib(n-2); return x + y; } And this parallel code:int fib(int n) { int x, y; if (n < 2) return n;...

View Article


What is required printf precision for a __float128 to not lose information?

I'm trying to printf a __float128 using libquadmath, eg:quadmath_snprintf(s, sizeof(s), "%.30Qg", f); With the following three constaints:The output must match the following production: number = [...

View Article

How to use Gcc 4.6.0 libquadmath and __float128 on x86 and x86_64

I have medium size C99 program which uses long double type (80bit) for floating-point computation. I want to improve precision with new GCC 4.6 extension __float128. As I get, it is a software-emulated...

View Article


Can clang Address Sanitizer be used if only main application was compiled...

My application uses static libs compiled with gcc: Boost( C++11 lambdas (with boost bind and boost function)) Bullet; system shared libraries such as SDL, and one shared library compiled with clang. Is...

View Article

Dynamic array initialization behavior of msvc differs from gcc and clang

Given the type struct S { int x; }; and two functionsS* f() { const auto x = new S[1] { { 42 } }; return x; } S* g() { const auto x = new S[1]; x[0] = {42}; return x; } one would think that f and g...

View Article

Does GCC inline C++ functions without the 'inline' keyword?

Does GCC, when compiling C++ code, ever try to optimize for speed by choosing to inline functions that are not marked with the inline keyword?

View Article
Browsing all 22144 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>