Need help in resolving Compilation error


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Need help in resolving Compilation error
# 1  
Old 05-20-2008
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  
Old 05-20-2008
No duplicate or cross-posting, read the rules.

Proceed here:

Compilation error : Please help

Thread closed.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

Compilation Error

I am getting the below given errors for the following program though all the variables have been declared and used appropriately. Please Help. The environment is AIX. Error: ------ "gbsizeprofile.c", line 67.4: 1506-275 (S) Unexpected text 'void' encountered. "gbsizeprofile.c", line 67.10:... (2 Replies)
Discussion started by: yschd
2 Replies

2. BSD

Help/Guidance in resolving: 'nfe0 tx v2 error 0X6004'

From ifconfig (Free BSD): nfe0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 options=8<VLAN_MTU> ether (ommited, but correct) inet 192.168.10.100 netmask 0Xffffff00 broadcast 192.168.10.255 media:Ethernet autoselect (100BaseTX <half-duplex> status: active ... (1 Reply)
Discussion started by: tomk
1 Replies

3. UNIX for Dummies Questions & Answers

Help/Guidance in resolving: 'nfe0 tx v2 error 0X6004'

From ifconfig (Free BSD): nfe0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 options=8<VLAN_MTU> ether (ommited, but correct) inet 192.168.10.100 netmask 0Xffffff00 broadcast 192.168.10.255 media:Ethernet autoselect (100BaseTX <half-duplex> status: active ... (1 Reply)
Discussion started by: tomk
1 Replies

4. Programming

Compilation error : Please help

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",... (1 Reply)
Discussion started by: jagan_kalluri
1 Replies

5. Programming

C Question compilation error

What does the following mean: state_field state_abvr = { "AL","ALABAMA", "AK","ALASKA", . . . }; extern state_field state_abvr; issues we I am facing following compilation issue bosdf9d1:root make CC -I/bto/bcs/shared/include -I/bto/sys/BCS/usr/include ... (1 Reply)
Discussion started by: jaganreddy
1 Replies

6. HP-UX

compilation error

hello everyone, here i am attempting to compile a c++ submodule.OS is HP-UX. here i am getting the following error. ====================================== "Make: Don't know how to make compile. Stop." =================================== could you pls somebody suggest why this error is... (2 Replies)
Discussion started by: mannam srinivas
2 Replies

7. Linux

c++ compilation error

Hello every one, here i am attempting to compile a c++ module using gcc.it is throwing a error . error: ==== > make -S dummyCHARGP /usr/local/bin/gcc -g -DDEBUG -DMAT -I. -I/swtemp/usbs/cc/unix-ce/root/subsys/lib/Linux/ -I/opt/dce/include -I/opt/dce/include/dce ... (12 Replies)
Discussion started by: mannam srinivas
12 Replies

8. Programming

Compilation error

I am compiling a software xchm on solaris 10. First i run './configure' There is no error. But when i start compiling using 'gmake' following error shown /usr/local/include/wx-2.6/wx/x11/brush.h: In copy constructor `wxBrush::wxBrush(const wxBrush&)':... (3 Replies)
Discussion started by: mansoorulhaq
3 Replies

9. Programming

compilation error

Hi, While trying compile a C++ file in UNIX with gcc whose make rule involves the usage of /usr/ccs/bin/as, I get the following error: /usr/ccs/bin/as: No such file or directory /usr/ccs/bin/as: error: write error on output file "<filename>.o" *** Error code 1 clearmake: Error: Build... (2 Replies)
Discussion started by: smanu
2 Replies

10. Programming

Regarding compilation error.

Hi All, I facing the following compilation error; when I implementing the following logic. ostrstream ostr; ostr << (( scAxsm.getRecord( i ).getField( 2 ).getShort())%12)!=0?(( scAxsm.getRecord( i ).getField( 2 ).getShort())/12+1) : (( scAxsm.getRecord( i ).getField( 2 ).getShort())/12) <<... (1 Reply)
Discussion started by: sweta
1 Replies
Login or Register to Ask a Question