Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 07-31-2013, 08:14 AM   #1
LQ Newbie
Registered: Jul 2013
Posts: 9

Rep: Reputation: Disabled
Question Problem using GCC output in GNAT (Mingw system)


this is my first post so I hope I'm doing it in the right forum but after checking the Programming forum I thought it's more about general programing questions.

Anyway, I'm new to Linux after programing on Visual Studio for years and I ran into quite some problems most of which I was able to solve but with this one I'm hitting a wall.

I installed Ubuntu13 64 recently and started to set up a development environment. Since I want to use it mostly for Ada I installed the GPS workbench from Ada core which comes with it's own version of the GCC toolset, I believe it is Mingw, at least on Windows it is, not sure if that's true on Linux as well.

Now my main interest is to develop console applications there, so I got the latest version of ncurses and did the usual ./configure make make install sequence and all went fine.

However now, when I make a simple hello world program in the GPS workbench (using the c++ compiler, no mixed language with Ada at all) I am getting this error message:

/usr/lib/libncurses.a: could not read symbols: File format not recognized
collect2: error: ld returned 1 exit status

So I guess that the compiler that comes with Adacore's GPS workbench is somehow not compatible with the standard gcc toolset that comes with Ubuntu?

Thanks for any help

PS I checked the compiler with gcc -v and it reports that it is the GNAT compiler so I guess there is no second toolset installed. I found some posts that pointed me in the direction of the archive manager ar and how to extract a file from it and test it with the file command and it turned out that the ncurses library is in 64 bit format, at least that's what I think, it says "ELF 64-bit, x86-64...". Perhaps that is the problem. But if it was compiled with the GCC that comes with Ada, why is it different when I make this library with make? When I check my test.o file that contains my hello world program it comes out as 32 bit. Is there a way to force the creation of a 32 bit library when I use make?

Last edited by DrVonBraun; 07-31-2013 at 08:57 AM.
Old 07-31-2013, 10:34 AM   #2
Senior Member
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,844

Rep: Reputation: 1478Reputation: 1478Reputation: 1478Reputation: 1478Reputation: 1478Reputation: 1478Reputation: 1478Reputation: 1478Reputation: 1478Reputation: 1478
Depends on the flags in the Makefile... gcc can create 32 bit or 64 bit code. Usually the compiler flags are listed with the name CFLAGS in the Makefile.

Frequently, the problem is running a 32 bit kernel on a 64 bit capable machine (sometimes picked by accident... to correct it usually requires a reinstallation as there are a LOT of other things that get limited).

It IS possible to run 32 bit binaries on a 64 bit linux (at least on Intel), it is not possible to run 64 bit binaries on a 32 bit linux (no 64 bit kernel calls for instance due to hardware limitations: no 64 bit hardware instructions available/registers..., 64 bit linux CAN support a 32 bit environment).
Old 07-31-2013, 11:08 PM   #3
LQ Newbie
Registered: Jul 2013
Posts: 9

Original Poster
Rep: Reputation: Disabled
Well thanks for the help. I am trying various things and the "best" that happens is a missing or incompatible crt1.o and crti.o linker error.
At this point I think that the 64 bit Linux I have installed is just giving me trouble. Since I am new to this thing and I dont want to have to deal with 32 and 64 bit compatibility issues I think I will install the 32 bit version of ubuntu and of the Gnat compiler system and hope that this solves my problems


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] gcc-gnat depends on OLDER version - pls help! emmalg Linux - Software 5 06-16-2009 08:56 AM
GCC Compile with GNAT BlackLabel Linux - Desktop 0 12-14-2006 01:22 PM
Link error with mingw-gcc FLLinux Programming 0 07-28-2006 09:38 PM
Compiling commercial apps in MinGW GCC? piggysmile Programming 1 04-20-2006 12:19 PM
gcc? g++? gnat? huh? foohooblue Mandriva 1 02-10-2006 12:23 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:33 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration