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

Image may be NSFW.
Clik here to view.

Is there a way to force multiply defined symbols using GCC/Clang on Linux?

I am working with two separate libraries (PLCIO and azure-iot-sdk-c) on a project. This project is being developed primarily on Windows using Visual Studio, but needs to run on Linux in production. I'm...

View Article


Mixing separately compiled objects

Let's I have a class class Drawable. It could have many members, member functions, parent classes, or could be very simple. For the sake of this example that is not important. Also, let's say it is...

View Article


GCC as m68k cross-compiler

I am trying to recompile binutils and GCC as a cross-compiler for m68k architecture. I am following these instructions:http://darkdust.net/writings/megadrive/crosscompilerHowever, the process keeps...

View Article

Undefined symbols with add_swig_library

I tried to write a simple usage example of SWIG with CMake, but I get the following error message:Undefined symbols for architecture x86_64: "_My_variable", referenced from: _Swig_var_My_variable_get...

View Article

Dump debug_loc section from executable

How do I dump debug_loc section from an executable on Linux if default options (-g) are provided to GCC while compiling a C file? I use readelf linux utility.GCC by default produces DWARF info in...

View Article


Does llvm 9 support std::filesystem on versions of the mac prior to 10.15?

I have an old Mac (circa 2009) running El Capitan version 10.11.6. Apple doesn't allow further updates of its OS on my machine, but through Macports it serves as a fine development environment for...

View Article

Allegro 5 game won't compile with GCC

I'm trying to port over a game that I made using Allegro 5.0 (from Windows to a Raspberry Pi running Raspian). I installed Allegro and moved over all my source files, but when I try to compile using:...

View Article

How do I force cxx11 ABI on Red Hat?

I'm building a small .so library on Ubuntu 16.04 and Red Hat 7 using gcc 7.3. When I check the export symbol names using the nm command, I find that the library compiled on Ubuntu uses the cxx11 ABI...

View Article


C code compiles on Virtual Machine with Ubuntu 18.04, not on Crouton: Struct...

I have a SDK for a camera that works without issue on Ubuntu 18.04 that I run through a virtual machine. I'm trying to get the camera to work on my chromebook, so I installed crouton. When I attempt to...

View Article


Conda install of gcc ends with link error, error loading shared library...

LSB Version: core-9.20170808ubuntu1-noarch:security-9.20170808ubuntu1-noarchDistributor ID: UbuntuDescription: Ubuntu 18.04.3 LTSRelease: 18.04Codename: bionicConda install of gcc results in the...

View Article

gcc assembler - create only the minimal instructions necessary

I have created a very minimal application in assembly. It sets some registers to 0 and does a multiplication. Nothing fancy.However, the gcc adds a lot of stuff to the machine code I do not want.A...

View Article

How to make compiler generate a "elf32-x86-64" format object file?

First, some background info about elf32-x86-64 format.It is a format that leverages 64-bit hardware while enforcing 32-bit pointers. Ref1 and Ref2.QuestionI am trying to link the Google Test framework...

View Article

Require understanding of increment in assembly during Undefined behaviors in...

I came across Undefined behavior in this C code below:#include <stdio.h> int main() { int x=0,y=5; printf("x=%d,x_1=%d,sum=%d",x++,x,y+x); return 0; } Just out of curiosity, i tried checking...

View Article


How to check the version of OpenMP on Linux

I wonder how to check the version of OpenMP on a Linux remote machine? I don't know where it is installed either.

View Article

How to calculate text& rodata& data& bss size of one module in C?

Dears, In my project, first compile aa_1.c, aa_2.c .. in folder A, compile bb_1.c bb_2.c .. from folder B. Then use gcc-ar achieves to libapps.a. At last, link with other static libraries. Now I want...

View Article


gcc and ld is refusing to link library statically

Just for fun (and for learning compiling in general), I gave myself the task to build a xorg-server with all libraries statically linked, except for glibc. For some reason, gcc simply ignores some of...

View Article

Changing calling convention in gcc/g++ abi

How could I enforce gcc/g++ to not use registers but only stack in x86_64 to pass arguments to functions, like it was in 32-bit version (and possibly take the function result this way). I know it...

View Article


Why is no warning given for the wrong use of __attribute__((pure)) in GCC?

I am trying to understand pure functions, and have been reading through the Wikipedia article on that topic. I wrote the minimal sample program as follows:#include <stdio.h> static int a = 1;...

View Article

error: unknown type name ‘FILE’

I am making a function which is just writes "hello" to a file. I have put it in a different file and included its header in the program.But gcc is giving an error namely: error: unknown type name...

View Article

Undefined reference to vtable

When building my C++ program, I'm getting the error message undefined reference to 'vtable...What is the cause of this problem? How do I fix it?It so happens that I'm getting the error for the...

View Article
Browsing all 22117 articles
Browse latest View live


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