Questions tagged [gcc]

17956 questions
1

votes
0

answer
151

Views

How to avoid generation of extra assembly instruction by gcc compiler for an inline assembly function

I have two questions about generation of assembly code by gcc as a result of using inline assembly function in C file. Let me first explains my situation/code and then I will ask questions. Situation: I have defined following macro NBL2SPM which calls the mySimMagic2() function. #define NBL2SPM(comp...
NUM
1

votes
1

answer
1.4k

Views

'CXXABI_1.3.11' not found`

I can't get a cross compiled build running on my Raspberry Pi 1 B+. The error I keep getting is: ImportError: /usr/lib/arm-linux-gnueabihf/libstdc++.so.6: version 'CXXABI_1.3.11' not found. I tried multiple compilers with different settings but I keep getting the same error. Also changing the LD_LI...
Sam
1

votes
1

answer
123

Views

tried to install a pythonn package but encountered “cannot find -lgcc_s” error

Hi I was trying to install a python package called 'pysptk' under the Ubuntu 16.04, but when I use: pip install pysptk I have encountered the following error. /usr/bin/ld: cannot find -lgcc_s collect2: error: ld returned 1 exit status error: command 'gcc' failed with exit status 1 However, I alread...
Luke
1

votes
0

answer
236

Views

Cross compiling gcc for Android

I am trying to cross compile gcc for Android using a toolchain generated by buildroot. ./configure --prefix=/home/Desktop/gcc_5/build/ CC=/home/buildroot-2017.02-rc3/output/host/usr/bin/aarch64-buildroot-linux-uclibc-gcc CXX=/home/buildroot-2017.02-rc3/output/host/usr/bin/aarch64-buildroot-linux-ucl...
Doha
1

votes
0

answer
825

Views

gcc: fatal error: no input files when compiling and linking a resource file with Code::Blocks

I grow tired from badly-made non-working or unnecessarily obfuscated user-hostile tools and programs. I am using Code::Blocks set to compile with Cygwin GCC (Compiler toolchain directory: C:\msys64\usr), I add a .rc file within my project and then when I compile I get this: === Build: Debug in Test...
1

votes
0

answer
89

Views

Bypass the faulty gcc “-mcygwin” argument, when building a library on python-3.4 on windows, through cygwin

I have the following problem: I want to build an external library of python on Windows through a script that uses gcc. When the script reaches the command: python setup.py build --compiler=cygwin, the following command is generated (that crashes): C:\cygwin64\bin\gcc.exe -mcygwin -mdll -O -Wall...
John Sig
1

votes
1

answer
59

Views

gcc showing errors from system library. -isystem doesnt work

Here is a simple (Deliberately wrong) c++ hello world program(https://pastebin.com/Cehm9yLx) #include using namespace std; int main() { int a; cout >> 'Hello World! Welcome!'
user9180468
1

votes
1

answer
84

Views

What are the temporary 'object' files (with alphanumeric file extensions) that are created during C compilation?

When I compile my C program I get certain files that are created temporarily for each object file. These temporary files are entitled utilities.o-fb62414b etc (i.e. something.o-suffix where 'something' is my object file and the suffix is alpha numeric characters). I can't find a description of the...
p-robot
1

votes
0

answer
510

Views

How do install gcc 4.4 and g++ 4.4 on Fedora 27

I have Fedora 27 and will compile a applicationh with gcc4.4 and g++4.4. But i can not install this version with yum or with update-alternatives Can you help me
jdeb
1

votes
1

answer
27

Views

Command line arguments to get total errors during compilation in gcc compiler

Is there any command line argument to list the total number of errors in the particular compilation. This would be useful when solving a hell lot of errors or when the sources are large in number. IDE's like Eclipse used to list the total number of errors and warnings.
iamnagaky
1

votes
0

answer
173

Views

Define a variable for linker in a Makefile

I use for gcc for compiling. In the ldscript, I have such a definition : STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x1000; I would like to define STACK_SIZEvariablz in a Makefile How should I proceed ? I ve tried this : STACK_SIZE=0 LDFLAGS = -DSTACK_...
Pierre Godicheau
1

votes
0

answer
61

Views

Is there an equivalent of link_warning(symbol) for C++?

Is it possible to define a C++ class method that would compile cleanly but produce a warning message when used, in a way similar to the unimplemented C library functions? Something like: int MyClass::frobnicate() { link_warning(frobnicate, 'function not implemented'); return 0; } An __attribute__((...
Dmitry Grigoryev
1

votes
0

answer
96

Views

Is it possible to make compiler split a returned structure value from a function into registers?

I'm looking for a way to have one (first) field of my structure returned from a function using a CPU register without allocating it on the stack. Assume we have a structure and functions returning it: template struct Pair { int code; T value; }; Pair FuncInt(bool const flag) { return {flag ? 0 :...
Dení
1

votes
0

answer
84

Views

Change gcc path for disutils

in ubuntu 16, anaconda python 3.5, when using setup.py and extension, disutils, it uses /usr/bin/gcc I would like to change to another path (for example where conda gcc is installed). but, don’t have sudo permission. How to do it ?
quantCode
1

votes
0

answer
839

Views

fatal error: stddef.h: No such file or directory

I'm following the guide below to build a mingw-w64 tool chain to cross compile for windows64 on Fedora 26. (I can't use the buildin tool chain, as the Fedora people decided to activate certain compiler options that i want disabled.) http://pete.akeo.ie/2010/07/compiling-mingw-w64-with-multilib-on.ht...
D. Asyl
1

votes
1

answer
268

Views

error: command 'gcc' failed with exit status 1 while installing pycrypto on RHEL

I am trying to manually install Crypto module for Python (pycrypto) on RHEL. However, I seem to always get this error after I run the build command (i.e. python setup.py build): error: command 'gcc' failed with exit status 1 Does anyone know how to solve this problem?
Felicia Amy
1

votes
2

answer
105

Views

Compiling GCC from source down to .s assembly file

I am doing binary code rewriting. The reason I do so is to robust the binary code without having access to its source code. So what I intend to do is to rewrite at the assembly level because it is much much more difficult to rewrite on the disassembly. What I want is the .s assembly file of the prog...
masec
1

votes
0

answer
41

Views

errorformat settings for gcc in german environment

Within english environment the error messages are as follows: make[5]: Entering directory '/home/krud/git_my_checkout/first/project_m' make[5]: Leaving directory '/home/krud/git_my_checkout/first/project_m' With german environment, the output from make with gcc looks like: make[5]: Verzeichnis „/h...
Klaus
1

votes
0

answer
68

Views

Getting a c++11 library on an older version of c++?

A remote machine that I don't own uses gcc 4.1.2 (2007 or so). I'd like to use the random library and its functions, which comes with the c++11 standard. Is there some way I can use the contents of ? Can I dump all of into a custom header? I lack understanding of libraries and wonder if there's a...
A Ton
1

votes
3

answer
61

Views

precision of floating-point data type in c++

Why the precision of floating-point data type does not grow proportional to its size? e.g.: std::cout
Bobo Feugo
1

votes
0

answer
14

Views

How to setup two different led delays for a specific sequence?

I am working on a program that is suppose to create a certain blink sequence on my arduino board (atmega328p). The pattern that I am trying to create is, ON for 1/2 second OFF for 1/2 second ON for 1/2 second Off for one full second Repeat this sequence. I approached the problem by creating two diff...
VAM7965
1

votes
0

answer
204

Views

LLVM LD option “-rpath-link”

When using the GNU LD for Linux to link some C code using the '-rpath-link' option it works well and as expected. However, when using the LLVM LD version 3.7.1 for Mac OS X to link the same C code using the '-rpath-link' option, LD gives an error ('unknown option'). My question is: what is the equiv...
user7698505
1

votes
0

answer
95

Views

leal and indirect addressing

Why is that replacing movl $84, 3(%rsi) with movl $3, %ecx leal (%esi, %ecx, 1), %r11d movl $84, (%r11d) results in Segmentation fault (core dumped) and how can I solve it? (I will be using %ecx as a counter later on to loop through the array) As I understand it, movl $84, 3(%rsi) moves...
xiuolpcpb
1

votes
0

answer
121

Views

Linking a program to libraries the use different _GLIBCXX_USE_CXX11_ABI each

I am trying to compile a program (using GCC 5.4.O) that depends on two libraries. Library A was compiled using the old ABI, while library B was compiled using the new C++11 ABI (see Dual ABI). If compile the program setting _GLIBCXX_USE_CXX11_ABI 1, I have linking errors with library A. If I set it...
toliveira
1

votes
0

answer
271

Views

Cannot deploy the precompiled header (.gch)

Could you, please, help me with warning: pch.hpp.gch: not used because '__STDC_IEC_559__' not defined emerging when I am trying to deploy a gcc-generated precompiled header with boost headers? Here is my toy model. File pch.hpp: #include #include #include #include and its complementary pch.cpp #...
Oleksii Rudenko
1

votes
0

answer
287

Views

Eclipse Crti.o and Crt1.o cannot find

I build sample code with cross compile linaro. I have two situations Situation 1: I download gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf from linaro website and extract it to path /home/xxx/opt/toolchains. I also export PATH=$PATH:/home/xxx/opt/toolchains/gcc-linaro-5.5.0-2017.10-x86_64_arm...
Trung Trinh
1

votes
2

answer
94

Views

C For Loop Comparison Using Function Doesn't Wait

This is kind of strange, imo, I have a for loop that does a comparison using the return value from a function. for (size_t i = 0; i < func(val); i++) { printf('Value from array modified in func = %u', values[i]); } The issue is the loop seems to run before the function is finished, if have a print...
will
1

votes
1

answer
1.2k

Views

Git Bash build doesn't work from terminal in VS Code

I have a fresh install of Windows 10 - 64bit MinGW - To install gcc Git 2.15.1.4 (64 bit ) VSCode 1.20 (64 bit) The command I am using is: g++ --version It doesn't work from using the terminal inside VSCode. However running bash window outside of VSCode, it works fine. Anybody know any suggestion...
user1840643
1

votes
1

answer
153

Views

How to add own custom function in standard shared library (C) in linux?

I have downloaded libgcrypt library source code and I want to customize this standard shared library by adding my function inside one particular source code file . Although compilation/build process of customized shared library is successful, but it shows error at linking time. Here is what I have...
bholanath
1

votes
1

answer
53

Views

Disassemble symbols on shared object file

I've a shared object xlib.so file built with Android-NDK which I need to deliver. I don't want it to be reverse engineered. I tried to use 'objdump' and created a disassembled version where I can see something like which seems like sort of function labels in front of addresses. Can I get rid of...
pilogo
1

votes
1

answer
341

Views

Cross Platform usage of printf_s and scanf_s functions - C (linux/win32) [duplicate]

This question already has an answer here: Disabling Warnings generated via _CRT_SECURE_NO_DEPRECATE 10 answers I'm currently trying to get some C code that I originally wrote for linux (gcc) to build on a win32 box. The MSVC compiler is giving me warnings for all my printf and scanf usage suggestin...
bph
1

votes
0

answer
103

Views

Less aggressive loop optimization when using printf than cout

This question is a followup to this one: Question on Undefined Behaviour (UB) and loop optimization When using https://godbolt.org/ online compiler (g++ 7.2, x86_64) with -O2 setting, the loop condition gets optimized out when the loop contains std::cout but not with an identical loop using printf....
Erik Alapää
1

votes
0

answer
56

Views

gcc: put all static/writable variables in the .data section

By default gcc will put all writable variables in the .bss section if they are zero-initialized, and otherwise in the .data section. This can be changed with an attribute: static bool initialized __attribute__(( section(.data) )) = false; Is there a way to apply this attribute to all the static/writ...
Byron Hawkins
1

votes
1

answer
70

Views

KDE Purpose build fails only in docker container

We currently encounter a strange issue with the latest KDE / Archlinux releases. We cannot get KDE's Purpose framework to compile inside a docker container, although it works fine on our host machines. We tried to compile it with GCC and Clang. The error we receive is: CMakeFiles/saveasplugin.dir/s...
Mydayyy
1

votes
0

answer
32

Views

Extract strings from AVR ihex file

I'm using avr-gcc to produce an elf file and later avr-objcopy -O ihex -R .eeprom main.elf main.hex to create a hex file for programming. How can I extract all strings from the generated hex file? I've tried avr-objdump -j .sec1 -D -m avr5 main.hex But this doesn't show any string. Background: The ....
Andy
1

votes
1

answer
182

Views

User defined integer literal not found

I am trying to create a user defined literal but get an error message when using it. GCC says unable to find numeric literal operator ‘operator''_uint’ while clang tells me error: no matching literal operator for call to 'operator''_uint' with argument of type 'unsigned long long' or 'const char...
Nobody
1

votes
1

answer
122

Views

Compiling Wifi driver for Linux: Void value not ignored as it ought to be

I am compiling a driver for a USB wifi for my machine. The code is very buggy (thanks TP-Link!) and I've had to make many corrections/modifications to the code - I am now at the last error, which has me stumped. The following line in the code is causing the problem: #define _seqdump seq_printf I can...
Homunculus Reticulli
1

votes
0

answer
486

Views

Why does gcc -march=native select broadwell on a coffeelake cpu?

Running on an i5-8600K cpu which has Coffee Lake microarchitecture. This page says I should use -march=skylake on GCC. However -march=native option seems to select Broadwell: $ gcc -march=native -Q --help=target | grep march -march= broadwell My GCC version is 7.3.0. Which...
henkkeli
1

votes
0

answer
27

Views

How can I reproduce CRAN errors for debian platform ?

I must correct some errors in my package antaresProcessing. I want to reproduce these errors before. Here, you can see CRAN Checks I don't have debian OS. I tried rhub, you can see that the results are ok I tried to execute these functions, all are fine. rhub::check_for_cran(platform = 'debian-...
Maaehj
1

votes
0

answer
74

Views

C++ - Can't compile functions of <cstdio> at ubuntu17.10 with g++ (Ubuntu 4.8.5-4ubuntu6) 4.8.5

I am new to this forum and have the following question. I recently installed ubuntu 17.10 (artful). My compiler is g++ (Ubuntu 4.8.5-4ubuntu6 (output of g++ --version). Unfortunately i cannot chose a newer compiler version, due to a specific framework i use. I wrote the following minimal example:...
Max Graf

View additional questions