Parsing error in project moved from Arduino IDE

This is my first attempt in using the PlatformIO IDE and my first post here. I copied the source from the Arduino IDE and made the necessary changes. I have not been able to find the cause of the parsing error shown below. Ideas please?

Error: Invalid ‘C:\Users\steve\OneDrive\Documents\PlatformIO\Projects\Alarm in PlatformIO\platformio.ini’ (project configuration file): 'Source contains parsing errors: ‘C:\Users\steve\OneDrive\Documents\PlatformIO\Projects\Alarm in PlatformIO\platformio.ini’
[line 45]: ‘void setup( )\n’
[line 46]: ‘{\n’
[line 102]: ‘} \n’
[line 104]: ‘void loop( ) \n’
[line 105]: ‘{\n’
[line 133]: ‘} \n’
[line 135]: ‘void Sound(T_Array[], notes, tonePin, ampPwr, val)\n’
[line 136]: ‘{\n’
[line 161]: ‘} \n’
[line 163]: ‘void Amp_On_Off(On_Off, Vol, ampPin)\n’
[line 180]: ‘} \n’
[line 182]: ‘void Set_Volume(Volume)\n’
[line 183]: ‘{\n’
[line 192]: '}

Is C++ source code in the platformio.ini?

That’s supposed to be in src/main.cpp.

Thank you! Got it working.

Sorry, but I cannot find the solution

Do you have this exact type of error message? If yes, post your platformio.ini.

Same as
[line 45]: ‘void setup( )\n’
[line 46]: ‘{\n’
[line 102]: ‘} \n’
[line 104]: ‘void loop( ) \n’
[line 105]: ‘{\n’
[line 133]: ‘} \n’

C++ code does not belong in the platformio.ini but in src/main.cpp. Can you post your file in full?

; PlatformIO Project Configuration File
;
;   Build options: build flags, source filter
;   Upload options: custom upload port, speed and extra flags
;   Library options: dependencies, extra library storages
;   Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

[env:uno]
platform = atmelavr
board = uno
framework = arduino
void setup(){
   Serial.begin(9600);
   pinMode(13, OUTPUT);  // Usaremos el pin 13 como salida. Los demás puertos son entradas por defecto.
  // pinMode(2, PULLUP);   // Definimos al pin 2 como entrada con una resistencia pull-up
  // servo.atach(9);       // Si hemos declarado un objeto de clase Servo ahora especificamos que el servo estará conectado al puerto 
puerto 9.
}
void loop(){
 digitalWrite(13, HIGH);
 delay(1000);
 digitalWrite(13, LOW);
 delay(1000);
// Al llegar aquí, el Arduino volverá a la primera línea y comenzará a ejecutar todas las instrucciones nuevamente. 
}

[{
“resource”: “/c:/Users/Gaston/Documents/PlatformIO/Projects/inicial-01/platformio.ini”,
“owner”: “PlatformIO”,
“severity”: 8,
“message”: “Parsing error: ‘void setup(){\n’”,
“startLineNumber”: 15,
“startColumn”: 1,
“endLineNumber”: 16,
“endColumn”: 1
}]

So why did you paste C++ code into the platformio.ini file? That must be removed there and moved to src/main.cpp instead.

Ok. Thanks you very much