error 1000: Unexpected symbol


 
Thread Tools Search this Thread
Operating Systems HP-UX error 1000: Unexpected symbol
# 1  
Old 02-17-2009
error 1000: Unexpected symbol

Hi All,
I have a code which is used for conversion from binary to ASCII.
This code works absolutely fine on Linux and Solaris
And the same is giving many errors and warnings on HPUX. The machine on which i am compliing is "HP-UX kautilya B.11.11 U 9000/800 876920620 unlimited-user license"

Below I have pasted the errors i get on compiling

cc: "converter.c", line 865: error 1000: Unexpected symbol: "{".
cc: "converter.c", line 915: error 1000: Unexpected symbol: "{".
cc: "converter.c", line 870: error 1588: "size" undefined.
cc: "converter.c", line 870: error 1566: Test expression in for must be scalar.
cc: "converter.c", line 919: error 1588: "first" undefined.
cc: "converter.c", line 925: error 1566: Test expression in for must be scalar.
cc: "converter.c", line 929: error 1560: Modifiable lvalue required with operator "++".
cc: "converter.c", line 931: error 1588: "j" undefined.
cc: "converter.c", line 931: error 1564: Expression in while must be scalar.
cc: "converter.c", line 934: error 1560: Modifiable lvalue required with operator "++".
cc: "converter.c", line 941: error 1000: Unexpected symbol: "else".
cc: "converter.c", line 948: warning 557: Missing declaration specifiers, "int" assumed.
cc: "converter.c", line 948: error 1584: Inconsistent type declaration: "cur_add".
cc: "converter.c", line 953: warning 558: Empty declaration.
cc: "converter.c", line 965: warning 557: Missing declaration specifiers, "int" assumed.
cc: "converter.c", line 965: error 1584: Inconsistent type declaration: "blkSize".
cc: "converter.c", line 965: error 1521: Incorrect initialization.
cc: "converter.c", line 968: warning 557: Missing declaration specifiers, "int" assumed.
cc: "converter.c", line 968: error 1584: Inconsistent type declaration: "version".
cc: "converter.c", line 968: error 1521: Incorrect initialization.
cc: "converter.c", line 971: error 1000: Unexpected symbol: "if".
cc: "converter.c", line 969: warning 557: Missing declaration specifiers, "int" assumed.
cc: "converter.c", line 969: error 1584: Inconsistent type declaration: "verval".
cc: "converter.c", line 969: error 1521: Incorrect initialization.
cc: "converter.c", line 972: error 1000: Unexpected symbol: "{".
cc: "converter.c", line 973: error 1584: Inconsistent type declaration: "blkSize1".
cc: "converter.c", line 973: error 1521: Incorrect initialization.
cc: "converter.c", line 974: warning 557: Missing declaration specifiers, "int" assumed.
cc: "converter.c", line 974: error 1584: Inconsistent type declaration: "blkSize1".
cc: "converter.c", line 974: warning 604: Pointers are not assignment-compatible.
cc: "converter.c", line 974: warning 563: Argument #1 is not the correct type.
cc: "converter.c", line 974: warning 604: Pointers are not assignment-compatible.
cc: "converter.c", line 974: warning 563: Argument #2 is not the correct type.
cc: "converter.c", line 974: error 1521: Incorrect initialization.
cc: "converter.c", line 977: error 1000: Unexpected symbol: "}".
cc: "converter.c", line 975: warning 557: Missing declaration specifiers, "int" assumed.
cc: "converter.c", line 975: error 1584: Inconsistent type declaration: "blockSize".
cc: "converter.c", line 975: error 1521: Incorrect initialization.
cc: "converter.c", line 980: error 1573: Type of "blockSize" is undefined due to an illegal declaratio
cc: "converter.c", line 980: error 1584: Inconsistent type declaration: "blockSize".
cc: "converter.c", line 980: error 1521: Incorrect initialization.
cc: "converter.c", line 982: error 1000: Unexpected symbol: "}".
cc: "converter.c", line 981: warning 557: Missing declaration specifiers, "int" assumed.
cc: "converter.c", line 991: warning 558: Empty declaration.
cc: "converter.c", line 998: error 1000: Unexpected symbol: "while".
cc: "converter.c", line 996: warning 557: Missing declaration specifiers, "int" assumed.
cc: "converter.c", line 1001: error 1000: Unexpected symbol: "!=".
cc: "converter.c", line 1041: error 1000: Unexpected symbol: "if".
cc: "converter.c", line 1039: error 1573: Type of "size" is undefined due to an illegal declaration.
cc: "converter.c", line 1041: error 1508: Illegal type combination.
cc: "converter.c", line 1044: warning 557: Missing declaration specifiers, "int" assumed.
cc: "converter.c", line 1047: error 1000: Unexpected symbol: "while".
cc: "converter.c", line 1045: warning 557: Missing declaration specifiers, "int" assumed.
cc: "converter.c", line 1045: error 1584: Inconsistent type declaration: "cur_add".
cc: "converter.c", line 1058: error 1000: Unexpected symbol: ";".
cc: "converter.c", line 1065: error 1000: Unexpected symbol: "for".
cc: "converter.c", line 1063: error 1573: Type of "size" is undefined due to an illegal declaration.
cc: "converter.c", line 1063: error 1584: Inconsistent type declaration: "size".
cc: "converter.c", line 1063: error 1521: Incorrect initialization.
cc: "converter.c", line 1065: error 1000: Unexpected symbol: ";".
cc: "converter.c", line 1066: error 1000: Unexpected symbol: "{".
cc: panic 2017: Cannot recover from earlier errors, terminating.

Can anyone help me please to resolve this as the errors that have come up seems to be so unrealistic like unexpected symbol ; and {. I also checked the lines where the error is reflected. But they seem absolutely fine as per C syntax and coding standards.

Hoping for a quick response.Thanks in advance
# 2  
Old 02-17-2009
HP-UX comes with a non ansi C compiler (for recompiling the kernel mostly...)
To compile software you would need more libraries ( quite sure) end perhaps an ANSI C:
What compiler are you using?

Code:
ant:/ $ which cc
/usr/bin/cc
ant:/ $ ls -al /usr/bin/cc
lrwxr-xr-t   1 root       sys             17 Jun 23  2003 /usr/bin/cc -> /opt/ansic/bin/cc

# 3  
Old 02-17-2009
What options are you using to compile?
# 4  
Old 02-17-2009
here is the sys detail abt cc.

$ uname -a
HP-UX kautilya B.11.11 U 9000/800 876920620 unlimited-user license

$ which cc
/usr/bin/cc

$ ls -al /usr/bin/cc
lr-xr-xr-t 1 ttsladm users 17 Sep 7 2005 /usr/bin/cc -> /opt/ansic/bin/cc

i compile the c code with -o and -D option like
cc -D FLAG -o OBJ_FILE converter.c
# 5  
Old 02-17-2009
Try to include the -Ae option on the compile line.

e.g. cc -Ae -D FLAG -o OBJ_FILE converter.c

The -Ae option indicates Extended ANSI mode. Same as -Aa -D_HPUX_SOURCE +e.
This would define the names (macros and typedefs) provided by the HPUX
Operating System and, in addition, allow the following extensions: $ characters
in identifier names, sized enums, sized bit-fields, and 64-bit integral type
long long. ( Info From HP Knowledge base...)
# 6  
Old 02-17-2009
The default C compiler on HPUX is next-to-useless. It is essentially a K&R compiler.
You have to pay extra to get an ANSI compiler.
# 7  
Old 02-18-2009
VBE:
i tried to compile my code with -Ae option but errors are still comming, i am pasting a few.

$ cc -Ae -D CONVERTERFLAG -o OBJ_FILE converter.c
cc: "converter.c", line 1139: error 1000: Unexpected symbol: "{".
cc: "converter.c", line 1165: error 1000: Unexpected symbol: "else".
cc: "converter.c", line 1175: error 1588: "newstrValue" undefined.
cc: "converter.c", line 1185: error 1588: "newstrValue" undefined.
cc: "converter.c", line 1185: warning 563: Argument #1 is not the correct type.
cc: "converter.c", line 1185: error 1594: The sizeof operator cannot be applied to types with unknown size.
cc: "converter.c", line 1204: error 1588: "newstrValue" undefined.
cc: "converter.c", line 1216: error 1588: "newstrValue" undefined.
cc: "converter.c", line 1226: error 1588: "newstrValue" undefined.
cc: "converter.c", line 1226: warning 563: Argument #1 is not the correct type.
cc: "converter.c", line 1226: error 1594: The sizeof operator cannot be applied to types with unknown size.
cc: "converter.c", line 1239: error 1588: "newstrValue" undefined.
cc: "converter.c", line 1253: error 1588: "newstrValue" undefined.

i really can't understand where the problem is in the code.

JIM:
Please can you tell me which compiler i can get installed so that i can compile the code sucessfully.


thanks in advance.

Last edited by junaid.nehvi; 02-18-2009 at 01:41 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

IF section problem. syntax error: unexpected end of file error

Hello, I have another problem with my script. Please accept my apologies, but I am really nooby in sh scripts. I am writing it for first time. My script: returned=`tail -50 SapLogs.log | grep -i "Error"` echo $returned if ; then echo "There is no errors in the logs" fi And after... (10 Replies)
Discussion started by: jedzio
10 Replies

2. Programming

gmake undefined symbol error

I have a C code which i am trying to compile using gcc. When i am trying to compile it i get the error undefined symbol error though i am providing the -l*** option where *** refers to the module where the object files for those symbols are present. Can someone help me on the same. (4 Replies)
Discussion started by: manaankit
4 Replies

3. Solaris

/usr/lib/passwdutil.so.1: symbol __nsl_fgetspent_r: referenced symbol not found

deleteing post (0 Replies)
Discussion started by: dshakey
0 Replies

4. Shell Programming and Scripting

Cron Job : unexpected symbol

Hello Experts, I am trying to setup a crontab with 2 jobs but getting the familiar error 0481-079 Reached a symbol that is not expected I would like to know if the below code is the only way to show a fixed interval. Don't we have something more efficient. ... (2 Replies)
Discussion started by: hkansal
2 Replies

5. Shell Programming and Scripting

sed error : Syntax error: redirection unexpected

My script is throwing the error 'Syntax error: redirection unexpected' My line of code.. cat nsstatustest.html | sed s/<tr><td align="left">/<tr><td align="left" bgcolor="#000000"><font color="white">/ > ztmp.Ps23zp2s.2-Fpps3-wmmm0dss3 HTML tags are getting in the way but they're needed to... (3 Replies)
Discussion started by: phpfreak
3 Replies

6. Programming

undefined symbol: clock_gettime' error

Hi, i've compiled my app on x86_64 with -m32 gcc option. Can anybody tell me what is/would typically cause the 'undefined symbol: clock_gettime' error?? -1 k){0N!x y} '/home/da71336/simon/mkvfh/mkv.so: undefined symbol: clock_gettime @ "q" "subr:mkv 2:`subr,3; subc:mkv 2:`subc,1;... (4 Replies)
Discussion started by: dpa078
4 Replies

7. Programming

Symbol referencing error

Hey everyone, I can't figure out this symbol referencing error after looking at it for the longest time, and I figured some fresh eyes might be able to point something out I am overlooking. Undefined first referenced symbol in... (1 Reply)
Discussion started by: fromatz
1 Replies

8. UNIX for Dummies Questions & Answers

awk Shell Script error : "Syntax Error : `Split' unexpected

hi there i write one awk script file in shell programing the code is related to dd/mm/yy to month, day year format but i get an error please can anybody help me out in this problem ?????? i give my code here including error awk ` # date-month -- convert mm/dd/yy to month day,... (2 Replies)
Discussion started by: Herry
2 Replies

9. Programming

symbol referencing error

Undefined first referenced symbol in file std::basic_ostream<char, std::char_traits<char> >::operator<<(int)/var/tmp//ccTR std::cerr /var/tmp//ccTRcjui.o std::cout /var/tmp//ccTRcjui.o... (1 Reply)
Discussion started by: suhasini
1 Replies

10. AIX

Error - Symbol Resolution Failed

Hi All, I am trying to run sqlplus on my AIX 5L box but following errors are thrown: $ sqlplus exec(): 0509-036 Cannot load program sqlplus because of the following errors: 0509-130 Symbol resolution failed for /usr/lib/libc.a because: 0509-136 Symbol kaio_rdwr64 (number 0)... (5 Replies)
Discussion started by: run_time_error
5 Replies
Login or Register to Ask a Question