Operating System - HP-UX
1834019 Members
2892 Online
110063 Solutions
New Discussion

Error when compile a C file with a aC++ compiler

 
SOLVED
Go to solution
Engo Armand-Blaise
Frequent Advisor

Error when compile a C file with a aC++ compiler

Hi,

I can not compiler any programme with a aC++ compilerversion A.03.37.

cyb_hpux[ /cyborg/global/g500i/prog ] $ aCC -V
aCC: HP ANSI C++ B3910B A.03.37
cyb_hpux[ /cyborg/global/g500i/prog ] $ aCC cybstdio.c
/usr/ccs/bin/ld: Unsatisfied symbols:
main (Not referenced yet! Probably due to -u option)
=============================================
Swlist result :

#
# Bundle(s):
#

B3913DB C.03.37 HP aC++ Compiler (S800)
B5456CA C.01.18.04 HP-UX Development Kit for Java*
B5725AA B.3.4.115 HP-UX Installation Utilities (Ign
ite-UX)
B6192AA B.11.00.10 DCE/9000 Programming & Administra
tion Tools Media and Manuals
B9788AA 1.3.0.01.02 Java 2 SDK 1.3 for HP-UX (700/800
), PA1.1 + PA2.0 Add On
B9789AA 1.3.0.01.02 Java 2 RTE 1.3 for HP-UX (700/800
), PA1.1 + PA2.0 Add On
HPUXEng32RT B.11.00.01 English HP-UX 32-bit Runtime Envi
ronment
Ignite-UX-11-00 B.3.4.115 HP-UX Installation Utilities for
Installing 11.00 Systems
OnlineDiag B.11.00.18.09 HPUX 11.0 Support Tools Bundle, S
ep 2001
QPK1100 B.11.00.54.7 Quality Pack for HP-UX 11.00, Sep
tember 2001
T1302AA A.01.03 HP-UX Workload Manager Toolkits
#
# Product(s) not contained in a Bundle:
#

BLINKLINK B.11.00 Blink Link (HP Incremental Linkin
g Facility)
PHCO_22020 1.0 ksh(1) cumulative patch
PHCO_23792 1.0 libpthreads cumulative patch.
PHCO_26111 1.0 libc cumulative header file patch

PHCO_27731 1.0 libc cumulative patch
PHKL_27813 1.0 POSIX AIO;getdirentries;MVFS;rcp;
mmap/IDS
PHKL_27980 1.0 VxFS 3.1 cumulative patch: CR_EIE
M
PHSS_24303 1.0 ld(1) and linker tools cumulative
patch
PHSS_24381 1.0 LIBCL patch
PHSS_25028 1.0 CPSlib Cumulative Patch (omp supp
ort 11.x)
PHSS_26320 1.0 MILLI/ASM cumulative patch
PHSS_26945 1.0 HP aC++ -AA runtime libraries (aC
C A.03.37)

==============================================

What should I need again?

In other term, when to find "HP aC++ Revision B.11.06" and "HPPAK HP Programmer's Analysis"

8 REPLIES 8
Steve Steel
Honored Contributor

Re: Error when compile a C file with a aC++ compiler

Hi


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

Will get you languages and tools


Also up your patches

PHCO_22020 replaced by PHCO_27418
PHCO_23792 replaced by PHCO_26960
PHKL_27813 replaced by PHKL_28202
PHSS_24303 replaced by PHSS_26559
PHSS_24381 replaced by PHSS_28302
PHSS_25028 replaced by PHSS_27699

Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
Engo Armand-Blaise
Frequent Advisor

Re: Error when compile a C file with a aC++ compiler

Thank you for updating the patches. I'm running B.11. with 32 bits and I still have the same error after rebooting the Server....

Is it because of there is no main statement in the source C program?

Please Let me know.
Engo Armand-Blaise
Frequent Advisor

Re: Error when compile a C file with a aC++ compiler

After updating the all patches step by step, ?I have the same Error :

cyb_hpux[ /cyborg/global/g500i/prog ] $ aCC -V
aCC: HP ANSI C++ B3910B A.03.39
cyb_hpux[ /cyborg/global/g500i/prog ] $ aCC cybstdio.c
/usr/ccs/bin/ld: Unsatisfied symbols:
main (Not referenced yet! Probably due to -u option)
==============================================
cybstdio.c [program to compile]

Contains of this program :
/*
* --------------------------------------------------------------------------
* VCS Archive: $Archive: //cybgenpurp/pvcs/pvcs66/cybprod/archives/eCyborg/ST/Server/Prog/Unix/Source-Delivered/Common/cybstdio.c-arc $
* --------------------------------------------------------------------------
* Name : $Workfile: cybstdio.c $
* Author : Carl Haynes
* Created : June 13 2001
* Revision Number : $Revision: 1.1 $
* Last Edited by : $Author: Carlh
* $Date: 03 May 2002 09:55:10 $
*
* Copyright 1998-2001, Cyborg Systems, All Rights Reserved An Unpublished
* Work of Cyborg Systems. This software and documentation contained herein
* are copyrighted works which include confidential information and trade
* secrets proprietary to Cyborg Systems, and shall not be copied, duplicated,
* disclosed or used, in whole or in part, except pursuant to the License
* Agreement or as otherwise expressly approved by Cyborg Systems.
* --------------------------------------------------------------------------
* Description
* File01 Control program standard I/O routines.
* --------------------------------------------------------------------------
* Notes:
* -----
* 1. WIN32/Microsoft Visual C++ 6.0
* Compilation requires option -MD to produce an object file that is
* compatible with object files produced by Merant Net Express 3.1
* --------------------------------------------------------------------------
*/

#include

#ifdef __cplusplus
extern "C"
{
extern int CYB_GET_INPUT(char* buffer);
extern void CYB_DISPLAY(const char* const start, int length);
}
#endif

/*
* CYB_GET_INPUT: This routine uses getchar to read input from stdin,
* places this input into buffer, then returns control to the calling
* routine.
*
* Return value:
* 0 indicates success.
* -1 indicates a read error or end-of-file condition.
*/
int CYB_GET_INPUT(char* buffer)
{
int ch = getchar();
if (ch == EOF)
return -1;
*buffer = (char)ch;
return 0;
}


/*
* CYB_DISPLAY: This routine uses putchar to write the content of memory
* pointed to by the 'start' parameter to stdout. The number of bytes
* output is determined by the value of the 'length' parameter. All
* buffered output streams are flushed before control is returned to the
* calling routine.
*/
void CYB_DISPLAY(const char* const start, int length)
{
int count = length;
const char* cp = start;
while (count-- > 0)
putchar((int)*cp++);
fflush(NULL);
return;
}


==============================================
See the attached file :


swlist_file {result from "swlist" command]



Steve Steel
Honored Contributor

Re: Error when compile a C file with a aC++ compiler

Hi

Sorry for the delay but busy today

Normally, if fastbind detects any unsatisfied symbols while building the fastbind information, it generates an error message and does not modify the executable file. When you invoke fastbind with the -u option however, it allows unresolved symbols.


Thus it is because of no main statement and you could try the -u


Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
Engo Armand-Blaise
Frequent Advisor

Re: Error when compile a C file with a aC++ compiler

That is perfect.

I used the -u option to compile my source program. But, what is about the output file, I mean the executable one.

I don't have any result.
Steve Steel
Honored Contributor

Re: Error when compile a C file with a aC++ compiler

HI

add the MAIN


Also see

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


Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
Adam J Markiewicz
Trusted Contributor
Solution

Re: Error when compile a C file with a aC++ compiler

Hi

I see your problemm.
But everythink is absolutelly perfect.

aCC tries to make an executable, as you can see actually it is LINKER who generates error (/usr/ccs/bin/ld).

If you only want to compile and get object only for futher linking, you should add option -c:

aCC -c cybstdio.c


Good luck
Adam
I do everything perfectly, except from my mistakes
Adam J Markiewicz
Trusted Contributor

Re: Error when compile a C file with a aC++ compiler

Hi

I see your problemm.
But everything is absolutely perfect.

aCC tries to make an executable, as you can see actually it is LINKER who generates error (/usr/ccs/bin/ld).

If you only want to compile and get object only for futher linking, you should add option -c:

aCC -c cybstdio.c


Good luck
Adam
I do everything perfectly, except from my mistakes