How do i use the using namespace vex; correctly?

I am trying to code my autonomous in Vex Coding Studio and when I try to compile the code I get a complication message " no member named ‘rotationUnits’ in namespace ‘vex’ "

Any helpful hints?

1 Like

Obligatory mention of “VCS is no longer supported, you should strongly consider moving to VEXcode Pro”.

It’s very difficult to debug code without being able to see it. Please post your complete program, remembering to wrap it in [code] … [/code] tags for formatting.

12 Likes

do you mean VCS doent work anymore

1 Like

VCS will work, but it is inferior to vexcode pro because it is not up to date and it will never be updated.

7 Likes

:roll_eyes:

will i have to restart my entire code in vexcode pro or will I be able to open my VCS programs

1 Like

In vexcode pro, open a competition template (via file > open example program > competition template) and ctrl+c lines in vcs and ctrl+v them in the appropriate areas and there should be minimal errors (it should be obvious where to copy and paste)

3 Likes

It’s not that big of a deal to switch from VCS to VexCode, and if you are wondering if you should switch or not, Vex is no longer updating VCS so you wont get new features like being
able to use the inertial sensor (correct me if I’m wrong on that).

2 Likes

Really. I just started coding in March

1 Like

I started coding a few weeks ago. I didn’t know how to code at all until about 1 month ago. I know it’s not that hard to switch because our main programmer last year had to.

2 Likes

If you start from a competition template and follow tutorials it’s pretty simple.

1 Like

The problem is that I have basically eased storage on my laptop. How long has vexcode pro been around

1 Like

i dont want to use vexcode pro i just want to get my auton going at the moment.

i get the message " no member named 'rotationUnits ’ in namespace ‘vex’ "

am i missing something in the section of my code below

vex::rotationUnits rotation = vex::rotationUnits::rev;

i have the #include "robot-config.h" tag.
WHAT AM I MISSING!!!

1 Like

fixed it.
now i have another issue
i try to compile and i get this message " cannot combine with previous ‘type-name’ declaration specifier void pre_auton (void) { text}

void pre_auton (void) { text}

what does it mean and how can i fix it

1 Like

I know this isn’t what you want to hear, but you really really really should switch to vexcode. vcs has been discontinued for over a year now (I think), and continuing to use it will cause you pain. vcs does not have any support for any of the newer devices, like the inertial sensor and the new unreleased sensors. (I’m pretty sure)
also vcs was just bad and buggy and not fun. use vexcode pro, I’m sure you can find some space on your computer for it. and you can pretty much just copy-paste your vcs program into a vexcode one with little trouble (some things might have changed in the last year, idk)

7 Likes

its easy enough to swap i just want to get my code done first

1 Like

much better to make the switch first. you’ll have a much better time finishing your program.

9 Likes

If you’ve added:

using namespace vex;

You should be able to do

rotationUnits rotation = rotationUnits::rev;

Because the compiler is able to recognize the usage. But, I’m unsure if this would work in VCS or not due to its lack of transparency.

1 Like

where should i put the rotationUnits rotation = rotationUnits::rev;
i should mention i have changed my code bygetting rid of that sentance

1 Like

Have you switched to vexcode yet? :slightly_smiling_face:

2 Likes

yes
anything more that could be helpful

1 Like