The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
pro*c compilation error satvd High Level Programming 0 05-21-2008 05:04 AM
Compilation error : Please help jagan_kalluri High Level Programming 1 05-20-2008 04:48 PM
compilation error mannam srinivas HP-UX 2 04-18-2008 01:52 PM
compilation error smanu High Level Programming 2 12-29-2006 10:11 AM
Regarding compilation error. sweta High Level Programming 1 12-10-2006 11:30 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-20-2008
jagan_kalluri jagan_kalluri is offline
Registered User
  
 

Join Date: May 2008
Location: ATLANTA GEORGIA USA
Posts: 25
Need help in resolving Compilation error

state_field state_abvr[] = {
"AL","ALABAMA",
"AK","ALASKA",
"AZ","ARIZONA",
"AR","ARKANSAS",
"CA","CALIFORNIA",
"CO","COLORADO",
"CT","CONNECTICUT",
"DE","DELAWARE",
"DC","DISTRICT-OF-COLUMBIA",
"FL","FLORIDA",
"GA","GEORGIA",
"HI","HAWAII",
"ID","IDAHO",
"IL","ILLINOIS",
"IN","INDIANA",
"IA","IOWA",
"KS","KANSAS",
"KY","KENTUCKY",
"LA","LOUISIANA",
"ME","MAINE",
"MD","MARYLAND",
"MA","MASSACHUSETTS",
"MI","MICHIGAN",
"MN","MINNESOTA",
"MS","MISSISSIPPI",
"MO","MISSOURI",
"MT","MONTANA",
"NE","NEBRASKA",
"NV","NEVADA",
"NH","NEW-HAMPSHIRE",
"NJ","NEW-JERSEY",
"NM","NEW-MEXICO",
"NY","NEW-YORK",
"NC","NORTH-CAROLINA",
"ND","NORTH-DAKOTA",
"OH","OHIO",
"OK","OKLAHOMA",
"OR","OREGON",
"PA","PENNSYLVANIA",
"PR","PUERTO-RICO",
"RI","RHODE-ISLAND",
"SC","SOUTH-CAROLINA",
"SD","SOUTH-DAKOTA",
"TN","TENNESSEE",
"TX","TEXAS",
"UT","UTAH",
"VT","VERMONT",
"VI","VIRGIN-ISLANDS",
"VA","VIRGINIA",
"WA","WASHINGTON",
"WV","WEST-VIRGINIA",
"WI","WISCONSIN",
"WY","WYOMING"
};
int num_states = XtNumber(state_abvr);

some where arond line no 1000:

varibale defined like this:

extern state_field state_abvr[];

but while compiling this code i am getting
below error:

cc: "cd_globals.c", line 1000: error 1000: Unexpected symbol: "state_abvr".

please help me how to resolve this error


I am using the above one in another file for test functionality :

code is like this:

/***************************************************************/
int test_state_abvr(char *string)
/**************************************************************/
{
int i, j, k;
char st[2];

#ifdef DEBUG
printf("at cd_string.c - ");
printf("in function - test_state_abvr\n");
printf("string = %s\n", string);
printf("num_states = %d\n", num_states);
#endif

for ( i=0;i<num_states;i++ ) {
strncpy(st, state_abvr[i].abvr, 2);
st[2] = 0;

#ifdef DEBUG
printf("i = %d ", i);
printf("st = %s ", st);
printf("state_abvr[i].abvr = %s ", state_abvr[i].abvr);
printf("state_abvr[i].state = %s\n", state_abvr[i].state);
#endif

if ( strcmp(string, st) == 0 ) {
return 1;
/*** state found - OK ***/
}
}

/*** state NOT found - NOT OK ***/
return 0;
}




while compiling this file i am getting error:


bosdf9d1:root make
/opt/ansic/bin/cc -c -Ae +DA1.0 +DS1.0 -DX11R5 -Aa -D_INCLUDE_HPUX_SOURCE -D_INCLUDE_XOPEN_SOURCE -D_INCLUDE_POSIX_SOURCE -D_INCLUDE_AES_SOURCE -I/bto/bcs/shared/include -I/bto/sys/BCS/usr/include -I/usr/include -I/bto/bcs/maint -I/usr/local/include -lc -lPW -I/usr/include/X11R5 -I/usr/include/Motif1.2 -I/usr/BCSshared -c cd_string.c
cc: "/usr/include/sys/time.h", line 530: warning 618: Declaration of "timeval" not visible outside this function prototype scope.
cc: "/usr/include/sys/time.h", line 542: warning 618: Declaration of "timeval" not visible outside this function prototype scope.
cc: "cd_globals.c", line 1000: error 1000: Unexpected symbol: "state_abvr".
cc: "cd_string.c", line 408: error 1588: "state_abvr" undefined.
cc: "cd_string.c", line 408: error 1529: Cannot select field of non-structure.
cc: "cd_string.c", line 408: warning 563: Argument #2 is not the correct type.
cc: "cd_string.c", line 408: warning 527: Integral value implicitly converted to pointer in assignment.
cc: "cd_string.c", line 408: warning 563: Argument #3 is not the correct type.
cc: "cd_string.c", line 431: error 1000: Unexpected symbol: "/".
*** Error exit code 1


need help in resolving this issue
  #2 (permalink)  
Old 05-20-2008
Franklin52 Franklin52 is online now Forum Staff  
Moderator
  
 

Join Date: Feb 2007
Posts: 4,304
No duplicate or cross-posting, read the rules.

Proceed here:

Compilation error : Please help

Thread closed.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:23 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0