What is wrong with my code cause it says I need a primary expresion cause I check my code when i code

It says this
(/usr/local/bin/arduino-cli compile --fqbn arduino:avr:mega:cpu=atmega2560 --libraries /home/builder/opt/libraries/latest --build-cache-path /tmp --output-dir /tmp/189918732/build --build-path /tmp/arduino-build-ED5BF0FEEC9B2D296CE9352643A3AC29 -v /tmp/189918732/LCD

Using board 'mega' from platform in folder: /home/builder/.arduino15/packages/arduino/hardware/avr/1.8.4

Using core 'arduino' from platform in folder: /home/builder/.arduino15/packages/arduino/hardware/avr/1.8.4

Detecting libraries used...

/home/builder/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I/home/builder/.arduino15/packages/arduino/hardware/avr/1.8.4/cores/arduino -I/home/builder/.arduino15/packages/arduino/hardware/avr/1.8.4/variants/mega /tmp/arduino-build-ED5BF0FEEC9B2D296CE9352643A3AC29/sketch/LCD.ino.cpp -o /dev/null

Alternatives for LiquidCrystal.h: [liquidcrystal_1_0_7@1.0.7]

ResolveLibrary(LiquidCrystal.h)

-> candidates: [liquidcrystal_1_0_7@1.0.7]

/home/builder/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I/home/builder/.arduino15/packages/arduino/hardware/avr/1.8.4/cores/arduino -I/home/builder/.arduino15/packages/arduino/hardware/avr/1.8.4/variants/mega -I/home/builder/opt/libraries/latest/liquidcrystal_1_0_7/src /tmp/arduino-build-ED5BF0FEEC9B2D296CE9352643A3AC29/sketch/LCD.ino.cpp -o /dev/null

/home/builder/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I/home/builder/.arduino15/packages/arduino/hardware/avr/1.8.4/cores/arduino -I/home/builder/.arduino15/packages/arduino/hardware/avr/1.8.4/variants/mega -I/home/builder/opt/libraries/latest/liquidcrystal_1_0_7/src /home/builder/opt/libraries/latest/liquidcrystal_1_0_7/src/LiquidCrystal.cpp -o /dev/null

Generating function prototypes...

/home/builder/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I/home/builder/.arduino15/packages/arduino/hardware/avr/1.8.4/cores/arduino -I/home/builder/.arduino15/packages/arduino/hardware/avr/1.8.4/variants/mega -I/home/builder/opt/libraries/latest/liquidcrystal_1_0_7/src /tmp/arduino-build-ED5BF0FEEC9B2D296CE9352643A3AC29/sketch/LCD.ino.cpp -o /tmp/arduino-build-ED5BF0FEEC9B2D296CE9352643A3AC29/preproc/ctags_target_for_gcc_minus_e.cpp

/home/builder/.arduino15/packages/builtin/tools/ctags/5.8-arduino11/ctags -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives /tmp/arduino-build-ED5BF0FEEC9B2D296CE9352643A3AC29/preproc/ctags_target_for_gcc_minus_e.cpp

Compiling sketch...

/home/builder/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I/home/builder/.arduino15/packages/arduino/hardware/avr/1.8.4/cores/arduino -I/home/builder/.arduino15/packages/arduino/hardware/avr/1.8.4/variants/mega -I/home/builder/opt/libraries/latest/liquidcrystal_1_0_7/src /tmp/arduino-build-ED5BF0FEEC9B2D296CE9352643A3AC29/sketch/LCD.ino.cpp -o /tmp/arduino-build-ED5BF0FEEC9B2D296CE9352643A3AC29/sketch/LCD.ino.cpp.o

Using library liquidcrystal_1_0_7 at version 1.0.7 in folder: /home/builder/opt/libraries/liquidcrystal_1_0_7

/tmp/189918732/LCD/LCD.ino: In function 'void setup()':

/tmp/189918732/LCD/LCD.ino:7:6: error: expected primary-expression before 'int'

Base(int v):value(<LiquidCrystal.h)

^~~

/tmp/189918732/LCD/LCD.ino:7:1: error: 'Base' was not declared in this scope

Base(int v):value(<LiquidCrystal.h)

^~~~

/tmp/189918732/LCD/LCD.ino: At global scope:

/tmp/189918732/LCD/LCD.ino:10:11: error: expected initializer at end of input

void loop()

^

Error during build: exit status 1)


And when I add a primary expression it says a id expresion

It is so strange.

and what is that line? what is Base what is ':value' and the rest doesn't make sense at all

Oh thanks then i will recode it and then delete the post

Hello albert_wu1234
You can start with the code examples provided by the IDE to gain the coding knowledge.
Have a nice day and enjoy coding in C++.

1 Like

Thanks cause I just started coding C++ and the Arduino kit so yeah!And you have a nice day to

Kind Regards

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.