1753361 Members
5279 Online
108792 Solutions
New Discussion юеВ

Re: Questions about GCC

 
SOLVED
Go to solution
Vadim Yezhakov
Advisor

Questions about GCC

1. Can i use shared libraries compiled on aCC in binaries compiled on GCC?
2.Can i compile 64-bit objects on GCC?
10 REPLIES 10
H.Merijn Brand (procura
Honored Contributor
Solution

Re: Questions about GCC

1. Yes
2. What architecture?

on PA-RISC, you need two gcc compilers: one for 32bit generation, and one for 64bit generation. They do not mix.

on Itanium, there is only one compiler, which is able to generate both.

To see all available options:

# gcc -v --help

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Arunvijai_4
Honored Contributor

Re: Questions about GCC

Hi Vadim,

1. Can i use shared libraries compiled on aCC in binaries compiled on GCC?

Yes, You can do it.

2. Can i compile 64-bit objects on GCC?

Ofcourse, Yes.

You need to have a 64 bit GCC for this. You can download from

http://h21007.www2.hp.com/dspp/tech/tech_TechSoftwareDetailPage_IDX/1,1703,7663,00.html

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Muthukumar_5
Honored Contributor

Re: Questions about GCC

1. Can i use shared libraries compiled on aCC in binaries compiled on GCC?

You can use that.

2.Can i compile 64-bit objects on GCC?

Based on the platform you can use. See model command output to see whether you machine is PA-RISC or Itanium.

64 bit gcc compiler is available for PA-RISC to support 64 bit.

--
Muthu
Easy to suggest when don't know about the problem!
Arunvijai_4
Honored Contributor

Re: Questions about GCC

Hello Vadim,

To compile 64 bit in GCC,

PA-RISC, you can install 64 bit compiler,

/usr/local/gcc64/bin/gcc as your compiler.

IA64, -mlp64 with GCC.

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Vadim Yezhakov
Advisor

Re: Questions about GCC

And one more question:
function names in GCC and aCC objects are different.
I must use extern "C" directive or i can use some key in compiler?
Arunvijai_4
Honored Contributor

Re: Questions about GCC

Hi Vadim,

You can use Key-in Directives for the portability.

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Arunvijai_4
Honored Contributor

Re: Questions about GCC

Hi Vadim,

You can also check these threads for more information,

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=36827
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=726526

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Steve Ellcey
Valued Contributor

Re: Questions about GCC

Just to clarify a point, when you say GCC do you mean the GCC C compiler only? Mixing GCC C code with aCC is fine but you cannot mix code compiled with the g++ compiler with code compiled with the aCC compiler. I.e. you can only use one C++ compiler but you can use it with code compiled with either the GNU or HP C compilers or both.

GCC (all uppercase) is usually interpreted as the GNU Compiler Collection, which includes both C and C++ compilers. gcc (lowercase) is the GCC C language compiler.
Vadim Yezhakov
Advisor

Re: Questions about GCC

I mean just g++ compiler. And code, compiled by aCC is C++ too.