Operating System - HP-UX
1834419 Members
2258 Online
110067 Solutions
New Discussion

Re: Cross platform C++ compiling

 
karel nijs
New Member

Cross platform C++ compiling

Hi,

i've developed a concurrent server in C++ on the Linux platform.
Now i have to make it available on the HP-UX platform.

I'm using STL, pthreads and some other POSIX funtions...
On the Linux platform, compiling works out fine, on the HP-UX i'm experiencing some difficulties.

I think most of my errors can be solved by setting all compiler options right.
I'm using the book "Advanced Unix Programming", but it doesn't say anything about compiling with STL and such...

Is there some (online?) documentation available on using HP-UX. g++ online?

Our HP-Ux version:
HP-UX B.11.00 A 9000/785
gcc version:
gcc version 2.95.3 20010315 (release)

Any help would be very appreciated...
4 REPLIES 4
Peter Godron
Honored Contributor

Re: Cross platform C++ compiling

Karel,
for a common problem:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=838354

For all the HP Documentation please see:
http://www.docs.hp.com/cgi-bin/search

Are you up-to-date on all patches.
Steve Steel
Honored Contributor

Re: Cross platform C++ compiling

Hi


Since Gcc is non hp

http://gcc.gnu.org/


http://h21007.www2.hp.com/dspp/tech/tech_TechDocumentDetailPage_IDX/1,1701,2504,00.html


is hp stuff

Steve Steel

If you want truly to understand something, try to change it. (Kurt Lewin)
Arunvijai_4
Honored Contributor

Re: Cross platform C++ compiling

Hi Karel,

Are you trying to build a cross compiler using GCC ? or you are building separeltely on HP-UX ?

http://devresource.hp.com/drc/index.jsp

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
karel nijs
New Member

Re: Cross platform C++ compiling

@steve steel: i can open your second link because i can't log in with my HP account there :-S

i'm not designing a cross compiler, i just want to compile my source files (.cpp), which work on Linux, on the HP-UX server.

I'm not allowed to install any patches


This is my Makefile:

# ****************************************


# Makefile for Separate Compilation Example
# Compiler: GNU C++ compiler
# Linker: /usr/bin/ld


# *****************************************************
# Parameters to control Makefile operation
# no errors -> -w
# all errors -> -Wall
# -Aa -> ANSI C
# -O -> optimalisation
# -D_XOPEN_SOURCE_EXTENDED -w -D_HPUX_SOURCE

CXX = g++
#CXXcommon = -lstdc++ -w -D_POSIX_C_SOURCE=199309L -MM -xc++ -Dunix
#CXXcommon = -lstdc++ -fpic -shared -w -static -D_POSIX_C_SOURCE=199309L -MM -xc++ -Dunix

CXXcommon = -fexceptions -lpthread -Wall -lstdc++ -features=castop
#-shared -fPIC
CXXFLAGS = -c
CXXFLAGSserv = -lpthread

# ****************************************************
# Entries to bring the executable up to date

server: server.cpp ASICclient.o ASIChost.o Connection.o Listener.o Networkfunctions.o ASICexception.o ASICserver.o Debug.o PSgen.o server.o network.h
$(CXX) $(CXXcommon) $(CXXFLAGSserv) -o server ASICclient.o ASIChost.o Connection.o Listener.o Networkfunctions.o ASICexception.o ASICserver.o Debug.o PSgen.o server.o


# server.o : server.cpp
# $(CXX) $(CXXcommon) $(CXXFLAGS) server.cpp


clean:
rm -rf *.o *.so

mrproper:
rm -rf *.o *.so a.out server


# ****************************************



as you can see, i've tried a lot of options (commented out) because everywhere on the Internet i find other options to set.
Actually, the situation has become more trial-and-error, that's why i asked for clear documentation online...