Console Error Compiling V5 C++

#1

Hi - I was doing some light dressing-up/formatting my code . When I went to compile I got a very strange error in the console (below)

I tried re-creating the file, rebooting PC, commenting out entire code, nothing seems to change in that I get the same error.

Any thoughts are appreciated! Thanks

test .vex (14.5 KB)

08:40:08 -- info -- changed directory: C:/Users/John/AppData/Local/VEX Coding Studio/VEX Coding Studio/sdk/user/
08:40:08 -- info -- C:/Users/John/AppData/Local/VEX Coding Studio/VEX Coding Studio/sdk/user/
08:40:08 -- info -- file removed: C:/Users/John/AppData/Local/VEX Coding Studio/VEX Coding Studio/sdk/user/cxx.o
08:40:08 -- info -- clang version 5.0.1 (tags/RELEASE_501/final) 
Target: thumbv7-none--eabi 
Thread model: posix 
InstalledDir: C:\Program Files (x86)\VEX Robotics\VEX Coding Studio\node_modules\@modkit\modkit-compiler-binaries-windows\clang\bin 
 "C:\\Program Files (x86)\\VEX Robotics\\VEX Coding Studio\\node_modules\\@modkit\\modkit-compiler-binaries-windows\\clang\\bin\\clang.exe" -cc1 -triple armv7-none--eabi -emit-obj -disable-free -disable-llvm-verifier -discard-value-names -main-file-name cxx_entry.cpp -mrelocation-model static -mthread-model posix -mdisable-fp-elim -fmath-errno -no-integrated-as -mconstructor-aliases -nostdsysteminc -target-cpu generic -target-feature +soft-float-abi -target-feature -fp-only-sp -target-feature -d16 -target-feature +vfp3 -target-feature -fp16 -target-feature -vfp4 -target-feature -fp-armv8 -target-feature +neon -target-feature -crypto -target-feature +strict-align -target-abi aapcs -mfloat-abi soft -v -dwarf-column-info -debugger-tuning=gdb -ffunction-sections -fdata-sections -coverage-notes-file "C:\\Users\\John\\AppData\\Local\\VEX Coding Studio\\VEX Coding Studio\\sdk\\user\\cxx.gcno" -nostdinc++ -resource-dir "C:\\Program Files (x86)\\VEX Robotics\\VEX Coding Studio\\node_modules\\@modkit\\modkit-compiler-binaries-windows\\clang\\lib\\clang\\5.0.1" -D _LIBCPP_HAS_NO_EXCEPTIONS -D _LIBCPP_HAS_NO_THREADS -D VexV5 -I . -I ../clang/7.0.0/include -I ../vexv5/include -I ../vexv5/gcc/include -I ../vexv5/gcc/include/c++/4.9.3 -I ../vexv5/gcc/include/c++/4.9.3/arm-none-eabi/armv7-ar/thumb -I ../modkit -internal-isystem "C:\\Program Files (x86)\\VEX Robotics\\VEX Coding Studio\\node_modules\\@modkit\\modkit-compiler-binaries-windows\\clang\\lib\\clang\\5.0.1\\include" -internal-isystem include -Os -Wno-unknown-attributes -Werror=return-type -Wall -std=gnu++11 -fdeprecated-macro -fdebug-compilation-dir "C:\\Users\\John\\AppData\\Local\\VEX Coding Studio\\VEX Coding Studio\\sdk\\user" -ferror-limit 19 -fmessage-length 0 -fallow-half-arguments-and-returns -fno-rtti -fshort-enums -fno-signed-char -fno-threadsafe-statics -fobjc-runtime=gcc -fdiagnostics-show-option -vectorize-loops -vectorize-slp -o cxx.o -x c++ cxx_entry.cpp 
clang -cc1 version 5.0.1 based upon LLVM 5.0.1 default target i686-pc-windows-msvc 
ignoring nonexistent directory "C:\Program Files (x86)\VEX Robotics\VEX Coding Studio\node_modules\@modkit\modkit-compiler-binaries-windows\clang\lib\clang\5.0.1\include" 
ignoring nonexistent directory "include" 
ignoring nonexistent directory "C:\Program Files (x86)\VEX Robotics\VEX Coding Studio\node_modules\@modkit\modkit-compiler-binaries-windows\clang\lib\clang\5.0.1\include" 
#include "..." search starts here: 
#include <...> search starts here: 
 . 
 ../clang/7.0.0/include 
 ../vexv5/include 
 ../vexv5/gcc/include 
 ../vexv5/gcc/include/c++/4.9.3 
 ../vexv5/gcc/include/c++/4.9.3/arm-none-eabi/armv7-ar/thumb 
 ../modkit 
End of search list. 
08:40:08 -- info -- make process failed with return code: 1
0 Likes

#2

could this be a ‘linking’ error I’ve seen mentioned?

0 Likes

#3

Hi I downloaded your program and got the same error as you on the first compilation. I then deleted the word ‘void’ in every function and it compiled. Hope this helps.

(Edit: In general, all errors that are not highlighted on the IDE are usually to do with function declaration, parameters or calling in my experience)

0 Likes

#4

WOW AKBAB - nice find! I did know this!

I’m sorry, I’ve deleting void everywhere and not having any luck. Would you mind uploading your so I can see what I’m missing?

0 Likes

#5

The problem is you have a forward ref to functions like this.

void aGrab(int, double, bool);     //CLAW BY ABSOLUTE DISTANCE

and then define the function with a different signature.

void aGrab(double deg, int s, bool b){
    GrabberArm.rotateTo(deg, vex::rotationUnits::deg,s, vex::velocityUnits::pct,b); //This command is blocking so the program will wait here until the right motor is done.  
    vex::task::sleep(20); 
}//end eGrab

so linker is looking for function defined with int, double, bool but yours is different.

0 Likes

#6

DOH! I see that! Corrected - MANY THANKS!!

0 Likes

#7

@poodlebytes sorry for the misinformation! Turns out I’d commented out some offending lines of code, deleted those voids and THEN it had compiled. Anyway glad you found the fix!

0 Likes

#8

it’s OK - I appreciate your help!! Best 2U!

0 Likes

#9

I’m having problem with a c++17 and I’m not very good at programming so any help would be nice

0 Likes

#10

I’m not a coder, but you should start a new thread instead of reviving an old one

0 Likes