Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

300
Vistas
-m32 option doesn't work with gcc but works with g++

I was trying to compile an application for 32 bit target on x86_64 ubuntu 12.04 machine. I installed the required packages using

sudo apt-get install gcc-multilib g++-multilib libc6-i386 libc6-dev-i386

The first command works generating the 32 bit version. However, the second command errors out

1. g++ -m32 hello.c 

2. gcc -m32 hello.c
skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.8/libgcc.a when searching for -lgcc
/usr/bin/ld: cannot find -lgcc
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.8/libgcc_s.so when searching for -lgcc_s
/usr/bin/ld: cannot find -lgcc_s

Could anyone explain to me why gcc fails to work. Am I missing some libraries?

Thanks!



over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

I upgraded my g++ to 4.8 and g++ -m32 stopped working too. Installing g++-4.8-multilib made -m32 option work with both gcc and g++.

over 4 years ago · Santiago Trujillo Denunciar

0

I think you need this package of Ubuntu:

sudo apt-get install ia32-libs

Also confirm that you are using gcc multilib with gcc -v. If not set path accordingly or re-install gcc-multilib.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda