Operating System - Linux
1753274 Members
4821 Online
108792 Solutions
New Discussion юеВ

Re: Compilation problem with HP UNIC GCC

 
SOLVED
Go to solution
Dennis Handly
Acclaimed Contributor

Re: Compilation problem with HP UNIC GCC

>The reason i want to use gcc is i want to link to a library file that is generated by gcc

You still need g++ to link.

>My idea is not to cause any conflicts between the lib file and the code which i want to compile with g++

Mangling issues have to be solved with source changes, as Steven mentions.

>Since both are GNU compilers i think there should not be any conflicts?

It's the same ABI.

>Steven: then you'll probably need to do some reading on how to combine C and C++ programs.

See the following:
http://docs.hp.com/en/10946/otherlangs.htm#callinghpc
CA1490051
Frequent Advisor

Re: Compilation problem with HP UNIC GCC

Hi All,

Thank you very much for your support


thanks and regards
Vikram
Srimalik
Valued Contributor

Re: Compilation problem with HP UNIC GCC


Now, why didn't I think of that? No, wait.
I did.

On the other hand:

dy # g++ ex1.cpp
ex1.cpp: In function 'int main()':
ex1.cpp:5: error: 'cout' was not declared in this scope
ex1.cpp:5: error: 'endl' was not declared in this scope

These errors can be solved by two ways:

1) using namspace std directive.
2) changing #include to

The second one will give a warning though, as using iostream.h is depricated.
abandon all hope, ye who enter here..
Dennis Handly
Acclaimed Contributor

Re: Compilation problem with HP UNIC GCC

>Srikrishan: These errors can be solved by two ways:

You forgot qualification:
std::cout <<" Hello World "<< std::endl;
Srimalik
Valued Contributor

Re: Compilation problem with HP UNIC GCC

symptoms of old age :)
abandon all hope, ye who enter here..