Solved

Compilation Errors..

Posted on 2006-07-18
10
226 Views
Last Modified: 2010-04-15
Compilation errors...
typedef struct ARPI_ADAPTOR_INFO {
  char protocol[MAX_READER_PROTO_LEN+1]; // reader side protocol implemented: slrrp, llrp, symbol-EBSP
  char major_version[MAX_MAJOR_VERSION_LEN+1];
  char minor_version[MAX_MINOR_VERSION_LEN+1];
  char patch_number[MAX_PATCH_NUM_LEN+1];
//  time_t buildTime; // Time at which adapter is built, provided by adapter.
}ARPI_ADAPTER_INFO ;

ARPI_ERROR_CODE   getInfo(ARPI_ADAPTER_INFO *adi);  // function ptr to get adapter info

ARPI_ERROR_CODE   (* ARPI_CALLBACK)(char  *buffer);
ARPI_ERROR_CODE   setCallback(ARPI_CALLBACK rb); // function ptr to set callback function

ARPI_ERROR_CODE getInfo(ARPI_ADAPTER_INFO *adi)
{
332:      adi->protocol = "slrrp";
333:      adi->major_version = "1";
334:      adi->minor_version = "2";
335:      adi->patch_number = "1";
}

342: ARPI_ERROR_CODE setCallback(ARPI_CALLBACK rb)
{}


Simba.c:332: incompatible types in assignment
Simba.c:333: incompatible types in assignment
Simba.c:334: incompatible types in assignment
Simba.c:335: incompatible types in assignment
Simba.c: At top level:
Simba.c:342: syntax error before "rb"

0
Comment
Question by:sudarshantk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
  • 2
  • +1
10 Comments
 
LVL 12

Expert Comment

by:rajeev_devin
ID: 17128505
>> adi->protocol = "slrrp";
All such assignment operator gives compilation error
0
 
LVL 12

Expert Comment

by:rajeev_devin
ID: 17128509
You need to use strcpy(...) function

Something like this
strcpy(adi->protocol, "slrrp");

Change other statements similarly.

Good luck !
0
 
LVL 8

Expert Comment

by:manish_regmi
ID: 17128511
use strcpy()
strcpy( adi->protocol, "slrrp");
strcpy( adi->major_version,  "1");
strcpy( adi->minor_version, "2");
strcpy( adi->patch_number, "1");

regards
Manish Regmi



0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:sudarshantk
ID: 17128523
what about error at line 342
0
 
LVL 12

Expert Comment

by:rajeev_devin
ID: 17128527
>> 332:     adi->protocol = "slrrp";
>> 333:     adi->major_version = "1";
>> 334:     adi->minor_version = "2";
>> 335:     adi->patch_number = "1";

This is the corrected statements
strcpy(adi->protocol, "slrrp");
strcpy(adi->major_version = "1");
strcpy(adi->minor_version = "2");
strcpy(adi->patch_number = "1);

0
 
LVL 8

Expert Comment

by:manish_regmi
ID: 17128535
use

typedef ARPI_ERROR_CODE   (* ARPI_CALLBACK)(char  *buffer);


0
 
LVL 7

Expert Comment

by:nafis_devlpr
ID: 17128815
what you are  trying to do is to assigne a const char type pointer to a char pointer. What you should be doing is this

strcpy(adi->protocol, "slrrp");
strcpy(adi->major_version, "1");
strcpy(adi->minor_version, "2");
strcpy(adi->patch_number, "1");

the final error is that you have used a type which is not defined properly, to solve this problem either do this

342: ARPI_ERROR_CODE setCallback((* ARPI_CALLBACK)(char  *buffer) rb)
{}

or this
#define ARPI_CALLBACK  ((* ARPI_CALLBACK)(char  *buffer))

ARPI_ERROR_CODE setCallback(ARPI_CALLBACK rb)
{}
0
 
LVL 12

Expert Comment

by:rajeev_devin
ID: 17128916
>> what you are  trying to do is to assigne a const char type pointer to a char pointer. What you should be doing is this
Seems nothing new. Same comments are already posted.
0
 
LVL 7

Accepted Solution

by:
nafis_devlpr earned 125 total points
ID: 17128953
rajeev

i was just giving him the explanation of the error message, nothing else. And sorry I didn't see the previous postings, damn quick post.
0
 
LVL 12

Expert Comment

by:rajeev_devin
ID: 17136169
To sudarshantk,
I don't know on what basic you accepted the answer.

We are not interested to waste our time unnecessarily. If you are posting solutions then go through every solution carefully.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question