Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Compilation Errors..

Posted on 2006-07-18
10
Medium Priority
?
229 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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 500 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.
Suggested Courses

636 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