Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Browsing all 21993 articles
Browse latest View live

How does GCC align struct in x64?

TL;DRWhen aligning the stack to multiple of 16 bytes, why are the paddings at the higher address for struct while at the lower address for primitive types?More detailsFirst of all, my machine follows...

View Article


Cannot modify data segment register. When tried General Protection Error is...

I have been trying to create an ISR handler following this tutorial by James Molloy but I got stuck. Whenever I throw a software interrupt, general purpose registers and the data segment register is...

View Article


How to use AddressSanitizer with GCC?

I'm trying to build my project with g++ -O0 -g -fsanitize=address -fno-omit-frame-pointer but get lots of errors like:/home/user/libs/opencv/include/opencv2/core/mat.hpp:715: undefined reference to...

View Article

Why is extra "../" getting added to ld search path on my system?

#include <iostream> using namespace std; int main() { cout << "Hello\n"; return 0; } If I compile the program above on my Ubuntu 18.04 system,$ g++ hello.cpp -o hello /usr/bin/ld: cannot...

View Article

How to use gdb with LD_PRELOAD

I run a program with LD_PRELOADing a specific library. Like this.LD_PRELOAD=./my.so ./my_program How do I run this program with gdb?

View Article


Throwing bad_exception when calling current_exception()

Link https://en.cppreference.com/w/cpp/error/current_exception provides the following description of current_exception():If called during exception handling (typically, in a catch clause), captures the...

View Article

Is there any way to make a function smartly in C such that it performs...

😄I have to create 2 structs namely rectangle and oval, where the rectangle structure contains its length and breadth and the oval structure contains the lengths of its semi-minor and semi-major axes....

View Article

GCC cannot compile libcurl example: ‘CURLINFO_TOTAL_TIME_T’ undeclared

I’m trying to compile libcurl’s example code fileupload.c with GCC on Ubuntu 18.04 LTS, getting the following error:~ gcc fileupload.c In file included from...

View Article


Python3, gcc and clang on MacOS

I am trying to make a Python script on my Mac (MacOS 10.14.6 Mojave) and I am getting trouble with installing a module (watchdog). I have the built-in Python 2 and I installed Python 3 with Homebrew....

View Article


GCC compile error for templated class method [duplicate]

This question already has an answer here:How to call a template member function? [duplicate] 2 answersI would like help understanding this gcc compilation error. The following c++ code is for what I...

View Article

GCC error when typedef name coincides with variadic template parameter name

I stumbled on a strange interaction between typedef and variadic template parameters that I'd like to understand. The following code compiles with clang but gives an error with GCC:template<typename...

View Article

About Variable-Size Stack Frames, about the alignment of stack frame,an...

C code:long vframe(long n, long idx, long *q) { long i; long *p[n]; p[0] = &i; for (i = 1; i < n; i++) p[i] = q; return *p[idx]; } Portions of generated assembly code:long vframe(long n, long...

View Article

Why is an extra "../" getting added to ld search path on my system?

#include <iostream> using namespace std; int main() { cout << "Hello\n"; return 0; } If I compile the program above on my Ubuntu 18.04 system,$ g++ hello.cpp -o hello /usr/bin/ld: cannot...

View Article


Can I use Intel syntax of x86 assembly with GCC?

I want to write a small low level program. For some parts of it I will need to use assembly language, but the rest of the code will be written on C/C++.So, if I will use GCC to mix C/C++ with assembly...

View Article

How to set gcc to use intel syntax permanently?

I have the following code which compiles fine with the gcc command gcc ./example.c. The program itself calls the function "add_two" which simply adds two integers. To use the intel syntax within the...

View Article


How to pass arguments to inline GCC/Clang asembly with Intel syntax? [duplicate]

This question already has an answer here:How to set gcc to use intel syntax permanently? 2 answersAll documentation uses AT&T syntax.int EAX; asm( "movl $5, %0" : "=a" (EAX) ); How do I re-write...

View Article

Qt requires C++11 support

I used Qt 5.7 and gcc 4.9.2. Qt Core module throw Qt requires C++11 support error.This page say that gcc 4.9.2 fails to compile Qt.So I installed gcc 4.8. I check using below command on terminal : $...

View Article


macOS : Brew-installed gcc throws link errors (ld: symbol(s) not found for...

I'm trying to compile a Pong game written by a friend using the SFML (https://www.sfml-dev.org/) graphics library. It works out of the box on Ubuntu, to make it run on macOS I've installed SFML via...

View Article

issue with assignment operator inside printf()

Here is the code int main() { int x=15; printf("%d %d %d %d",x=1,x<20,x*1,x>10); return 0; } And output is 1 1 1 1I was expecting 1 1 15 1 as output,x*1 equals to 15 but here x*1 is 1 , Why ?...

View Article

Program cannot load shared libary GCC

First things first, here is the error message: ./Game: error while loading shared libraries: libEngine.so: cannot open shared object file: No such file or directoryThere was no problems while...

View Article
Browsing all 21993 articles
Browse latest View live


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