View unanswered posts | View active topics It is currently Thu Oct 02, 2014 8:43 am






Reply to topic  [ 26 posts ]  Go to page 1, 2  Next
Compile Errors and Warnings after upgrading to RobotC 3.x 
Author Message
Rookie
User avatar

Joined: Sat Sep 03, 2011 10:03 am
Posts: 32
Post Compile Errors and Warnings after upgrading to RobotC 3.x
After upgrading to RobotC version 3.0 I am seeing new compiler errors and warnings on files that were compiling fine before the upgrade. Any suggestions to resolve would be appreciated.

Specifically there are warnings on some unchanged drivers such as LEGOLS-driver.h where it now complains about the following: "while(bSoundActive);" It does not like the semicolon after the while statement even though it is correct. It warns:
*Warning*:';' found following 'while' statement. Is this intentional?

Secondly, the compiler gets errors on the "servoChangeRate[Fence] = 10;" even though Fence is defined in the pragma statement it says that it is undefined. **Error**:Undefined variable 'Fence'. 'short' assumed. All other servo functions work but not servoChangeRate.

Last and hardest to figure out:
#pragma config(Sensor, S2, HTGYRO, sensorNone)
.......................
GyroCalibrate = HTGYROstartCal(HTGYRO);//* Do a Gyro Calibrate *//

Gets the following errors/warnings:
**Error**:Undefined variable 'HTGYRO'. 'short' assumed.
**Error**:Multiple overloads for 'HTGYROstartCal' match [including some numeric conversions]
*Warning*:Selected: HTGYROstartCal(tMUXSensor muxsensor)
Converted:1001500/10 Converting variable 'muxsensor' from numeric 'int' to typedef 'tMUXSensor'
*Warning*:Worse: HTGYROstartCal(tSensors link)
Converted:1001500/10 Converting variable 'link' from numeric 'int' to typedef 'tSensors'
*Warning*:Invalid '=' operation for types 'tMUXSensor' and 'short'


Sat Sep 03, 2011 10:45 am
Profile
Rookie
User avatar

Joined: Sat Sep 03, 2011 10:03 am
Posts: 32
Post Re: Compile Errors and Warnings after upgrading to RobotC 3.
Warning problem fixed with a compiler flag to not give that warning. Other two need suggestions.

Where can I find the "servoChangeRate" routine?


Sat Sep 03, 2011 11:13 am
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3223
Location: Rotterdam, The Netherlands
Post Re: Compile Errors and Warnings after upgrading to RobotC 3.
I haven't had a chance to check how my drivers compile and work with 3.0 so please bear with me.

The warnings are just that, warnings, they can be safely ignored. I will add something to make the warnings go away.

What program is giving you the gyro issues? Is it one of my examples or something you wrote yourself?

- Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Sat Sep 03, 2011 11:56 am
Profile WWW
Rookie
User avatar

Joined: Sat Sep 03, 2011 10:03 am
Posts: 32
Post Re: Compile Errors and Warnings after upgrading to RobotC 3.
I was able to get rid of the warnings by unchecking the flag in the compiler to give those type of warnings.

I am using a program I wrote to use the Gyro and it was working. I have attached it. Also a copy of the newest HTGyro-driver that I am using.

Any help is appreciated. Where is the servoChangerate[xxx] function located?


Last edited by Mentor3923 on Sat Sep 03, 2011 4:56 pm, edited 1 time in total.



Sat Sep 03, 2011 12:33 pm
Profile
Rookie
User avatar

Joined: Sat Sep 03, 2011 10:03 am
Posts: 32
Post Re: Compile Errors and Warnings after upgrading to RobotC 3.
If you need additional files please let me know. If you notice I had to use the gyro in short bursts since it seemed to be unreliable over longer periods. I hope to perfect using it over time. Will probably need it for the next game.


Sat Sep 03, 2011 12:44 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3223
Location: Rotterdam, The Netherlands
Post Re: Compile Errors and Warnings after upgrading to RobotC 3.
Can you attach the following files, please:
**Severe*:Couldn't open '#include' file '../Includes/3923_Defines.h'
**Severe*:Couldn't open '#include' file '3923_ElevatorRoutines.c'
**Severe*:Couldn't open '#include' file '3923_TroughRoutines.c'
**Severe*:Couldn't open '#include' file '3923_MotorRoutines.c'
**Severe*:Couldn't open '#include' file '3923_BalanceRobot.c'
**Severe*:Couldn't open '#include' file '3923_ClawRoutines.c'

Thanks,
Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Sat Sep 03, 2011 1:05 pm
Profile WWW
Rookie
User avatar

Joined: Sat Sep 03, 2011 10:03 am
Posts: 32
Post Re: Compile Errors and Warnings after upgrading to RobotC 3.
Here are the files you requested. You will now have my "Secret Sauce" ;-)

:lol:

FILES REMOVED~


Last edited by Mentor3923 on Sat Sep 03, 2011 4:58 pm, edited 2 times in total.



Sat Sep 03, 2011 1:11 pm
Profile
Rookie
User avatar

Joined: Sat Sep 03, 2011 10:03 am
Posts: 32
Post Re: Compile Errors and Warnings after upgrading to RobotC 3.
Here are the remaining files.

I had to break them up due to the 3 file limit.



FILES REMOVED~


Last edited by Mentor3923 on Sat Sep 03, 2011 4:57 pm, edited 1 time in total.



Sat Sep 03, 2011 1:14 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3223
Location: Rotterdam, The Netherlands
Post Re: Compile Errors and Warnings after upgrading to RobotC 3.
If you prefer, you can remove them from here and mail them to me. I am cooking dinner so it's a bit hard to do that from the forums here. You know the address, it's in all of the header files :)

- Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Sat Sep 03, 2011 1:17 pm
Profile WWW
Rookie
User avatar

Joined: Sat Sep 03, 2011 10:03 am
Posts: 32
Post Re: Compile Errors and Warnings after upgrading to RobotC 3.
I will be leaving in the next 15 minutes for about two hours or so. If you need any more, please let me know soon and I will send it to you.

I am really glad you are in today and can help me out.

Since I have them uploaded already and have to leave, pull them when you can. When I see that you have downloaded them, I will remove them. New Game, New Robot, not too many secrets. ;-)


Sat Sep 03, 2011 1:22 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3223
Location: Rotterdam, The Netherlands
Post Re: Compile Errors and Warnings after upgrading to RobotC 3.
Hey there,

I looked at the code and I am not sure what the problem is. I don't have the Tetrix platform and while I can chose it as a platform, I don't really have experience with dealing with configuration issues, which this clearly seems to be.

You might want to contact support@robotc.net about this. When you do, make sure you zip all the files together and attach it.

There doesn't seem to be an issue with my drivers, though. Meanwhile I have removed the code that causes the warnings but I can assure you they are harmless.

- Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Sat Sep 03, 2011 2:34 pm
Profile WWW
Rookie
User avatar

Joined: Sat Sep 03, 2011 10:03 am
Posts: 32
Post Re: Compile Errors and Warnings after upgrading to RobotC 3.
Thanks for looking at the code. I was not worried about the warnings as I knew they were harmless but 2.26 did not flag those issues. I guess 3.0 is defaulted differently.

I have removed those files and will zip them up and submit them to support. Do you happen to know where to find "changeServoRate" function? Maybe I can figure out that issue.

Thanks again.


Sat Sep 03, 2011 5:02 pm
Profile
Rookie
User avatar

Joined: Sat Sep 03, 2011 10:03 am
Posts: 32
Post Re: Compile Errors and Warnings after upgrading to RobotC 3.
I have resolved the problem with the HTGYRO errors. It was a config problem as you suspected. Even though the #pragma statement shows the GYRO sensor and the name given it, since it was configured as no sensor all of that info was not part of the sensor and motor setup. Do a Sensor and Motor setup and look what comes up. It comes up as blank name. I went back and looked at your third party samples and they configure it as "analogInactive" . I set mine up the same way and the errors went away. All I have left is the "servoChangeRate" problem.

Also the new Compiler has a lot of new and different flags that were not part of 2.x. Flagging those types of errors is a user option and the default is YES!


Sat Sep 03, 2011 5:49 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3223
Location: Rotterdam, The Netherlands
Post Re: Compile Errors and Warnings after upgrading to RobotC 3.
I have noticed that sometimes between versions of ROBOTC, it is a good idea to just rerun the motor and sensor configuration UI just to make sure nothing has changed :) Often just changing a single motor or sensor to one type and then back to the old and then clicking OK will set everything right.

- Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Sun Sep 04, 2011 1:19 am
Profile WWW
Creator
Creator

Joined: Fri Feb 09, 2007 9:21 am
Posts: 615
Post Re: Compile Errors and Warnings after upgrading to RobotC 3.
It was intentional that the new compiler warning on NULL statement following a conditional statement flag a warning. This is the standard behavior of Microsoft's Visual Studio as well. It catches the unintentional ';' after a 'while' as in the following
Code:
while (x < 5);  // the ';' is unintentional
{
  ... intended code as part of the while
}

The warning was generated as a result of other user feedback based on programming errors because of the usually undersired NULL statement from the ';'.


Sun Sep 04, 2011 10:54 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 26 posts ]  Go to page 1, 2  Next

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.