Home > OS >  How to solve Assertion Fail in GCC Compiler, C
How to solve Assertion Fail in GCC Compiler, C

Time:08-10

Hello dudes and dudettes!

When I compile my C program on Ubuntu (a VirtualMachine in VirtualBox), which previously ran without errors under Windows, I get a segmentation fault.

/usr/bin/ld: BFD (GNU Binutils for Ubuntu) 2.38 assertion fail ../../bfd/reloc.c:8580
/home/rafael/projects/Send06/lib/x86-64//libstar-api.a(dwzh.o):fake:(.idata$2 0x0): dangerous relocation: collect2: fatal error: ld terminated with signal 11 [Segmentation fault], core dumped
compilation terminated.
make: *** [Makefile:382: Send06] Error 1

I understand what a segmentation fault is, but I do not comprehend how this could happen in an external library. The source code of the library is not available.

Steps I took:

  1. Compiled a "Hello World!" program. --> no errors.
  2. Enlarged the virtual RAM. --> no changes.

Can you help me? Thanks in advance.


System: Windows 10

VM: Ubuntu 22.04.01 LTS

IDE: Qt Creator 8

Compiler: gcc 11.2.0

CodePudding user response:

I confused a Linux with a Windows library!

The answer is quite simple. I had a folder with libraries with the ending xyz.lib and xyz.a. So I thought, .lib for Windows and .a for Linux. However, there was seperate distribution of libraries for Linux. Now everything works.

Thank you for your input!

  • Related