Cquery error, c libraries and pathing is not recognized

Hello, I have an issue on my windows pc, whereby trying to use the pros IDE and use libraries like okapi and so are not able to be compiled. I reinstalled, the ide numerous times but it didn’t seem to work. I will post images that reflect that issues.

The image shows that the regular header reference is not able to be simply mentioned, specific reference is required. So if I were to include a header I would have to call "#include “…/include/main.h”. I think other people who have the IDE working don’t have to that. image

Hi Daler,

Have you tried building your project yet? Those red highlights aren’t real issues for the header files and are the linter (highlights errors) falsely highlighting the headers at the top. Building your project with correct syntax will fix the issue (be sure to also read below about this).

However, the main issue seems to be that you aren’t using a namespace with your declarations. This can be solved by either typing using namespace okapi; (or pros if you’re using PROS api), or doing something like okapi::MotorGroup to explicitly declare something in the correct namespace.

Hope this helps!

2 Likes

Yes, this is the real crux of the issue. I am not able to build my project/upload it due to this error. This prevents me from compiling. This prevents me from understanding where the issues are and I am not even sure where the logic is wrong.

1 Like

Your PATH is not updated - open a windows powershell type prosv5 at prompt if you don’t get output fix your PATH - if you do get output then there is a further issue - in which case uninstall pros, restart machine and re download the installer as shown in installation for windows guide, in my experience with students wrong path update ids often the reason for the described problem.

3 Likes

Agreed with vexteacher. Also, posting the output of the error would also help us very much.

1 Like

is there a way to copy the terminal output? Because it exists after it fails to build. Ctrl + Shift + C doesn’t seem to work. Also prosv5 works fine from what I could tell. I will also try to reinstall again.

1 Like

You can try taking a screenshot and posting it here. I’d like to see the terminal output if prosv5 is working then.

1 Like

image

1 Like

Screenshots of the errors

1 Like


The images after I reinstalled pros (64-bit version).

1 Like

Post your code this does not look like a PROS issue but rather a problem with your code

I suggest to take a look at this too: Okapi Errors

2 Likes

This is a group project and it functions perfectly well, just not on my computer. We are able to upload the project to the robot and use all functions. This is why it’s a bit frustrating. Thank you for providing the link I will check it out.

1 Like

Your probably using an old version of the code, missing an include, or have different versions of okapi.

Sorry, I don’t think this is what causes the issue. To clarify I had this issue for a while now, and I have consistently “blindly” coded the project and uploaded it. The code compiles and runs on other computers like macs run that code well and sound (since it’s on github), the issue is with the setup on my computer. I suspect it’s something with a cquery and pathing, but I don’t know how to fix this.

1 Like

You’ll have to give us more info. Maybe a zipped version of the project or some way to view it.

To clarify a couple of things for you, cquery is only a linter. It doesn’t compile your project, so that’s not the issue. Paths to include files are agonistic of where the project is located, so that also isn’t the issue. The compiler would also spit out an error about not being able to find a file. Based on your thoughts, I’m guessing you ran into "main.h" Not Found (Linter), but this isn’t your issue here.

It very much looks like you’re missing an include/your code isn’t right. (Did you forget to push/change branches?)

2 Likes

Unfortunately, I am not able to upload files, because I am a new user. If you could provide your email or anyone who is curious enough I can send it like that.

The issue is present all the time. Even when I pull or push. The image here shows an output from a project I pulled yesterday.

24_bot.zip (24.9 MB) Oh my restrictions have been lifted, here is the code.

first, you don’t need the …/include part of the include. See the can’t find main.h link I posted earlier. Secondly, you have a loop in your includes. You have deviceDefinitions including main.h including deviceDefinitions. I’m guessing how different compilers implement pragma once is the cause of your inconsistency. You can fix this by including the okapi header in deviceDefinitions.h.

Lastly, it looks like you’re using the okapi 3.x api, but are building against okapi 4.x. There have been breaking changes in 4, which is why some other stuff isn’t compiling in the zip you gave me. Make sure you’re using the same version of okapi thoughout. You should be able to change the version with some prosv5 conductor commands (add --help to see what they all are).

1 Like

So I tried the methods you mentioned (updated okapi, compiled the project using prosv5 command and fixing the inclusion by directly including okapi) but I still get this error.
Compiled src/main.cpp [WARNINGS]
In file included from ./include/main.h:43:0,
from src/main.cpp:1:
./include/subFuncts/deviceDefinitions.h:4:8: error: ‘MotorGroup’ does not name a type
extern MotorGroup leftDrive;
^~~~~~~~~~
./include/subFuncts/deviceDefinitions.h:5:8: error: ‘MotorGroup’ does not name a type
extern MotorGroup rightDrive;
^~~~~~~~~~
./include/subFuncts/deviceDefinitions.h:6:8: error: ‘MotorGroup’ does not name a type
extern MotorGroup revLeftDrive;
^~~~~~~~~~
./include/subFuncts/deviceDefinitions.h:7:8: error: ‘MotorGroup’ does not name a type
extern MotorGroup revRightDrive;
^~~~~~~~~~
./include/subFuncts/deviceDefinitions.h:10:8: error: ‘MotorGroup’ does not name a type
extern MotorGroup side_Rollers;
^~~~~~~~~~
./include/subFuncts/deviceDefinitions.h:11:8: error: ‘MotorGroup’ does not name a type
extern MotorGroup left_Flywheel;
^~~~~~~~~~
./include/subFuncts/deviceDefinitions.h:12:8: error: ‘MotorGroup’ does not name a type
extern MotorGroup right_Flywheel;
^~~~~~~~~~
./include/subFuncts/deviceDefinitions.h:14:8: error: ‘Controller’ does not name a type; did you mean ‘_strtoll_r’?
extern Controller MainController;
^~~~~~~~~~
_strtoll_r
./include/subFuncts/deviceDefinitions.h:21:8: error: ‘ControllerButton’ does not name a type
extern ControllerButton rampUpButton;
^~~~~~~~~~~~~~~~
./include/subFuncts/deviceDefinitions.h:22:8: error: ‘ControllerButton’ does not name a type
extern ControllerButton rampDownButton;
^~~~~~~~~~~~~~~~
./include/subFuncts/deviceDefinitions.h:23:8: error: ‘ControllerButton’ does not name a type
extern ControllerButton sideRollerInButton;
^~~~~~~~~~~~~~~~
./include/subFuncts/deviceDefinitions.h:24:8: error: ‘ControllerButton’ does not name a type
extern ControllerButton sideRollerOutButton;
^~~~~~~~~~~~~~~~
src/main.cpp: In function ‘void opcontrol()’:
src/main.cpp:29:19: error: ‘leftDrive’ was not declared in this scope
.withMotors(leftDrive,rightDrive)
^~~~~~~~~
src/main.cpp:29:29: error: ‘rightDrive’ was not declared in this scope
.withMotors(leftDrive,rightDrive)
^~~~~~~~~~
src/main.cpp:40:27: error: ‘MainController’ was not declared in this scope
drive->getModel()->tank(MainController.getAnalog(ControllerAnalog::leftY),
^~~~~~~~~~~~~~
src/main.cpp:44:7: error: ‘rampUpButton’ was not declared in this scope
if (rampUpButton.isPressed()){
^~~~~~~~~~~~
src/main.cpp:45:4: error: ‘left_Flywheel’ was not declared in this scope
left_Flywheel.moveVelocity(600);
^~~~~~~~~~~~~
src/main.cpp:47:14: error: ‘rampDownButton’ was not declared in this scope
} else if (rampDownButton.isPressed()){
^~~~~~~~~~~~~~
src/main.cpp:48:4: error: ‘left_Flywheel’ was not declared in this scope
left_Flywheel.moveVelocity(-600);
^~~~~~~~~~~~~
src/main.cpp:53:4: error: ‘left_Flywheel’ was not declared in this scope
left_Flywheel.moveVelocity(0);
^~~~~~~~~~~~~
src/main.cpp:58:7: error: ‘sideRollerInButton’ was not declared in this scope
if (sideRollerInButton.isPressed())
^~~~~~~~~~~~~~~~~~
src/main.cpp:60:4: error: ‘side_Rollers’ was not declared in this scope
side_Rollers.moveVelocity(600);
^~~~~~~~~~~~
src/main.cpp:61:4: error: ‘right_Flywheel’ was not declared in this scope
right_Flywheel.moveVelocity(450);
^~~~~~~~~~~~~~
src/main.cpp:65:12: error: ‘sideRollerOutButton’ was not declared in this scope
else if (sideRollerOutButton.isPressed())
^~~~~~~~~~~~~~~~~~~
src/main.cpp:67:4: error: ‘side_Rollers’ was not declared in this scope
side_Rollers.moveVelocity(-600);
^~~~~~~~~~~~
src/main.cpp:68:4: error: ‘right_Flywheel’ was not declared in this scope
right_Flywheel.moveVelocity(-450);
^~~~~~~~~~~~~~
src/main.cpp:74:3: error: ‘side_Rollers’ was not declared in this scope
side_Rollers.moveVelocity(0);
^~~~~~~~~~~~
mv: cannot stat ‘.d/main.Td’: No such file or directory
make: [common.mk:271: bin/main.cpp.o] Error 1 (ignored)
Compiled src/subFuncts/autoFunctions.cpp [WARNINGS]
In file included from src/subFuncts/…/…/include/main.h:43:0,
from src/subFuncts/autoFunctions.cpp:1:
src/subFuncts/…/…/include/subFuncts/deviceDefinitions.h:4:8: error: ‘MotorGroup’ does not name a type
extern MotorGroup leftDrive;
^~~~~~~~~~
src/subFuncts/…/…/include/subFuncts/deviceDefinitions.h:5:8: error: ‘MotorGroup’ does not name a type
extern MotorGroup rightDrive;
^~~~~~~~~~
src/subFuncts/…/…/include/subFuncts/deviceDefinitions.h:6:8: error: ‘MotorGroup’ does not name a type
extern MotorGroup revLeftDrive;
^~~~~~~~~~
src/subFuncts/…/…/include/subFuncts/deviceDefinitions.h:7:8: error: ‘MotorGroup’ does not name a type
extern MotorGroup revRightDrive;
^~~~~~~~~~
src/subFuncts/…/…/include/subFuncts/deviceDefinitions.h:10:8: error: ‘MotorGroup’ does not name a type
extern MotorGroup side_Rollers;
^~~~~~~~~~
src/subFuncts/…/…/include/subFuncts/deviceDefinitions.h:11:8: error: ‘MotorGroup’ does not name a type
extern MotorGroup left_Flywheel;
^~~~~~~~~~
src/subFuncts/…/…/include/subFuncts/deviceDefinitions.h:12:8: error: ‘MotorGroup’ does not name a type
extern MotorGroup right_Flywheel;
^~~~~~~~~~
src/subFuncts/…/…/include/subFuncts/deviceDefinitions.h:14:8: error: ‘Controller’ does not name a type; did you mean ‘_strtoll_r’?
extern Controller MainController;
^~~~~~~~~~
_strtoll_r
src/subFuncts/…/…/include/subFuncts/deviceDefinitions.h:21:8: error: ‘ControllerButton’ does not name a type
extern ControllerButton rampUpButton;
^~~~~~~~~~~~~~~~
src/subFuncts/…/…/include/subFuncts/deviceDefinitions.h:22:8: error: ‘ControllerButton’ does not name a type
extern ControllerButton rampDownButton;
^~~~~~~~~~~~~~~~
src/subFuncts/…/…/include/subFuncts/deviceDefinitions.h:23:8: error: ‘ControllerButton’ does not name a type
extern ControllerButton sideRollerInButton;
^~~~~~~~~~~~~~~~
src/subFuncts/…/…/include/subFuncts/deviceDefinitions.h:24:8: error: ‘ControllerButton’ does not name a type
extern ControllerButton sideRollerOutButton;
^~~~~~~~~~~~~~~~
src/subFuncts/autoFunctions.cpp:6:18: error: ‘ChassisControllerFactory’ has not been declared
auto audoDrive = ChassisControllerFactory::create
^~~~~~~~~~~~~~~~~~~~~~~~
src/subFuncts/autoFunctions.cpp:8:3: error: ‘leftDrive’ was not declared in this scope
leftDrive,
^~~~~~~~~
src/subFuncts/autoFunctions.cpp:8:3: note: suggested alternative: ‘audoDrive’
leftDrive,
^~~~~~~~~
audoDrive
src/subFuncts/autoFunctions.cpp:9:3: error: ‘rightDrive’ was not declared in this scope
rightDrive,
^~~~~~~~~~
src/subFuncts/autoFunctions.cpp:9:3: note: suggested alternative: ‘audoDrive’
rightDrive,
^~~~~~~~~~
audoDrive
src/subFuncts/autoFunctions.cpp:16:1: error: expected primary-expression before ‘)’ token
);
^
src/subFuncts/autoFunctions.cpp:18:25: error: ‘AsyncControllerFactory’ has not been declared
auto baseMPController = AsyncControllerFactory::motionProfile(1.0,2.0,10.0,autoDrive);
^~~~~~~~~~~~~~~~~~~~~~
src/subFuncts/autoFunctions.cpp:18:76: error: ‘autoDrive’ was not declared in this scope
auto baseMPController = AsyncControllerFactory::motionProfile(1.0,2.0,10.0,autoDrive);
^~~~~~~~~
src/subFuncts/autoFunctions.cpp:18:76: note: suggested alternative: ‘autoChoose’
auto baseMPController = AsyncControllerFactory::motionProfile(1.0,2.0,10.0,autoDrive);
^~~~~~~~~
autoChoose
mv: cannot stat ‘.d/subFuncts/autoFunctions.Td’: No such file or directory
make: [common.mk:271: bin/subFuncts/autoFunctions.cpp.o] Error 1 (ignored)
Compiled src/subFuncts/deviceDefinitions.cpp [WARNINGS]
In file included from src/subFuncts/…/…/include/main.h:43:0,
from src/subFuncts/deviceDefinitions.cpp:1:
src/subFuncts/…/…/include/subFuncts/deviceDefinitions.h:4:8: error: ‘MotorGroup’ does not name a type
extern MotorGroup leftDrive;
^~~~~~~~~~
src/subFuncts/…/…/include/subFuncts/deviceDefinitions.h:5:8: error: ‘MotorGroup’ does not name a type
extern MotorGroup rightDrive;
^~~~~~~~~~
src/subFuncts/…/…/include/subFuncts/deviceDefinitions.h:6:8: error: ‘MotorGroup’ does not name a type
extern MotorGroup revLeftDrive;
^~~~~~~~~~
src/subFuncts/…/…/include/subFuncts/deviceDefinitions.h:7:8: error: ‘MotorGroup’ does not name a type
extern MotorGroup revRightDrive;
^~~~~~~~~~
src/subFuncts/…/…/include/subFuncts/deviceDefinitions.h:10:8: error: ‘MotorGroup’ does not name a type
extern MotorGroup side_Rollers;
^~~~~~~~~~
src/subFuncts/…/…/include/subFuncts/deviceDefinitions.h:11:8: error: ‘MotorGroup’ does not name a type
extern MotorGroup left_Flywheel;
^~~~~~~~~~
src/subFuncts/…/…/include/subFuncts/deviceDefinitions.h:12:8: error: ‘MotorGroup’ does not name a type
extern MotorGroup right_Flywheel;
^~~~~~~~~~
src/subFuncts/…/…/include/subFuncts/deviceDefinitions.h:14:8: error: ‘Controller’ does not name a type; did you mean ‘_strtoll_r’?
extern Controller MainController;
^~~~~~~~~~
_strtoll_r
src/subFuncts/…/…/include/subFuncts/deviceDefinitions.h:21:8: error: ‘ControllerButton’ does not name a type
extern ControllerButton rampUpButton;
^~~~~~~~~~~~~~~~
src/subFuncts/…/…/include/subFuncts/deviceDefinitions.h:22:8: error: ‘ControllerButton’ does not name a type
extern ControllerButton rampDownButton;
^~~~~~~~~~~~~~~~
src/subFuncts/…/…/include/subFuncts/deviceDefinitions.h:23:8: error: ‘ControllerButton’ does not name a type
extern ControllerButton sideRollerInButton;
^~~~~~~~~~~~~~~~
src/subFuncts/…/…/include/subFuncts/deviceDefinitions.h:24:8: error: ‘ControllerButton’ does not name a type
extern ControllerButton sideRollerOutButton;
^~~~~~~~~~~~~~~~
mv: cannot stat ‘.d/subFuncts/deviceDefinitions.Td’: No such file or directory
make: [common.mk:271: bin/subFuncts/deviceDefinitions.cpp.o] Error 1 (ignored)
Compiled src/subFuncts/driveFuncts.cpp [WARNINGS]
In file included from src/subFuncts/…/…/include/main.h:43:0,
from src/subFuncts/driveFuncts.cpp:1:
src/subFuncts/…/…/include/subFuncts/deviceDefinitions.h:4:8: error: ‘MotorGroup’ does not name a type
extern MotorGroup leftDrive;
^~~~~~~~~~
src/subFuncts/…/…/include/subFuncts/deviceDefinitions.h:5:8: error: ‘MotorGroup’ does not name a type
extern MotorGroup rightDrive;
^~~~~~~~~~
src/subFuncts/…/…/include/subFuncts/deviceDefinitions.h:6:8: error: ‘MotorGroup’ does not name a type
extern MotorGroup revLeftDrive;
^~~~~~~~~~
src/subFuncts/…/…/include/subFuncts/deviceDefinitions.h:7:8: error: ‘MotorGroup’ does not name a type
extern MotorGroup revRightDrive;
^~~~~~~~~~
src/subFuncts/…/…/include/subFuncts/deviceDefinitions.h:10:8: error: ‘MotorGroup’ does not name a type
extern MotorGroup side_Rollers;
^~~~~~~~~~
src/subFuncts/…/…/include/subFuncts/deviceDefinitions.h:11:8: error: ‘MotorGroup’ does not name a type
extern MotorGroup left_Flywheel;
^~~~~~~~~~
src/subFuncts/…/…/include/subFuncts/deviceDefinitions.h:12:8: error: ‘MotorGroup’ does not name a type
extern MotorGroup right_Flywheel;
^~~~~~~~~~
src/subFuncts/…/…/include/subFuncts/deviceDefinitions.h:14:8: error: ‘Controller’ does not name a type; did you mean ‘_strtoll_r’?
extern Controller MainController;
^~~~~~~~~~
_strtoll_r
src/subFuncts/…/…/include/subFuncts/deviceDefinitions.h:21:8: error: ‘ControllerButton’ does not name a type
extern ControllerButton rampUpButton;
^~~~~~~~~~~~~~~~
src/subFuncts/…/…/include/subFuncts/deviceDefinitions.h:22:8: error: ‘ControllerButton’ does not name a type
extern ControllerButton rampDownButton;
^~~~~~~~~~~~~~~~
src/subFuncts/…/…/include/subFuncts/deviceDefinitions.h:23:8: error: ‘ControllerButton’ does not name a type
extern ControllerButton sideRollerInButton;
^~~~~~~~~~~~~~~~
src/subFuncts/…/…/include/subFuncts/deviceDefinitions.h:24:8: error: ‘ControllerButton’ does not name a type
extern ControllerButton sideRollerOutButton;
^~~~~~~~~~~~~~~~
src/subFuncts/driveFuncts.cpp:21:17: error: ‘leftDrive’ was not declared in this scope
.withMotors(leftDrive,rightDrive)
^~~~~~~~~
src/subFuncts/driveFuncts.cpp:21:27: error: ‘rightDrive’ was not declared in this scope
.withMotors(leftDrive,rightDrive)
^~~~~~~~~~
src/subFuncts/driveFuncts.cpp:37:25: error: ‘leftDrive’ was not declared in this scope
.withMotors(leftDrive,rightDrive)
^~~~~~~~~
src/subFuncts/driveFuncts.cpp:37:35: error: ‘rightDrive’ was not declared in this scope
.withMotors(leftDrive,rightDrive)
^~~~~~~~~~
src/subFuncts/driveFuncts.cpp: In function ‘void shoot()’:
src/subFuncts/driveFuncts.cpp:52:5: error: ‘left_Flywheel’ was not declared in this scope
left_Flywheel.moveVelocity(-600);
^~~~~~~~~~~~~
src/subFuncts/driveFuncts.cpp:54:5: error: ‘right_Flywheel’ was not declared in this scope
right_Flywheel.moveVelocity(-300);
^~~~~~~~~~~~~~
src/subFuncts/driveFuncts.cpp: In function ‘void sideRollers()’:
src/subFuncts/driveFuncts.cpp:64:5: error: ‘side_Rollers’ was not declared in this scope
side_Rollers.moveVelocity(600);//turn on side rollers
^~~~~~~~~~~~
src/subFuncts/driveFuncts.cpp:64:5: note: suggested alternative: ‘sideRollers’
side_Rollers.moveVelocity(600);//turn on side rollers
^~~~~~~~~~~~
sideRollers
src/subFuncts/driveFuncts.cpp: In function ‘void intake()’:
src/subFuncts/driveFuncts.cpp:71:3: error: ‘left_Flywheel’ was not declared in this scope
left_Flywheel.moveVelocity(-200);
^~~~~~~~~~~~~
src/subFuncts/driveFuncts.cpp:72:3: error: ‘side_Rollers’ was not declared in this scope
side_Rollers.moveVelocity(200);
^~~~~~~~~~~~
src/subFuncts/driveFuncts.cpp:72:3: note: suggested alternative: ‘sideRollers’
side_Rollers.moveVelocity(200);
^~~~~~~~~~~~
sideRollers
mv: cannot stat ‘.d/subFuncts/driveFuncts.Td’: No such file or directory
make: [common.mk:271: bin/subFuncts/driveFuncts.cpp.o] Error 1 (ignored)
Adding timestamp [OK]
Linking hot project with ./bin/cold.package.elf and okapilib,libm,libc,libpros [ERRORS]
arm-none-eabi-g++.exe: error: bin/main.cpp.o: No such file or directory
arm-none-eabi-g++.exe: error: bin/subFuncts/autoFunctions.cpp.o: No such file or directory
arm-none-eabi-g++.exe: error: bin/subFuncts/deviceDefinitions.cpp.o: No such file or directory
arm-none-eabi-g++.exe: error: bin/subFuncts/driveFuncts.cpp.o: No such file or directory
make: *** [common.mk:239: bin/hot.package.elf] Error 1
Capturing metadata for PROS Editor…
Error: Failed to build

OK so there are a multitude of basic C++ coding problems in your project, including mixed use of namespace as well as mixing use of older okapi library calls while your project is on the 4.X release of okapi. Your problem is NOT a PROS environment issue, as matter effect PROS is doing which it is supposed to do, hinting at your coding errors. (working to fix errors from the top down - i.e. first error addressed first, recompile see if it is fixed and onwards will get you very quickly toa few errors left which are all about mis matching of okapi library specific calls)

You have basic include file issues, you have mis-declaration of external variables.

May I suggest that you start out perhaps for now rewriting your code and doing so by first writing your basic code in the main.cpp file, once you get that going, thinking about how to use functionality specific sub-files/includes to help you understand how that works within in the C++ / okapi context.

I did get your code to compile ultimately, but needed to do a LOT of rewrite/fixing.

Good luck

3 Likes