Unable to compile program

Welcome to the community !!!
unable to understand which kind of help you expect with so little information about your issue. Could you please tell us a little bit more about your project/problem ? then maybe we can help :slight_smile:


I am trying to run just simple function but still unable to compile it. I have installed install compiler tool chain, clean environment and compile locally as well but still unable to compile it. Just got a message in terminal with “terminated with exit code 2”.

try this…

/*
 * Project SimpleApp
 * Description:
 * Author:
 * Date:
 */
//  os  2.1.0       
//  device = Argon

//   library includes HERE
#include "Particle.h"

int g_errCode = 0;

SerialLogHandler logHandler;  // Use primary serial over USB interface for logging output

//  choose your SYSTEM_MODE       uncomment one statement to activate or skip
//SYSTEM_MODE(AUTOMATIC);         //  default SYSTEM_MODE is AUTOMATIC
//SYSTEM_MODE(SEMI_AUTOMATIC);          
SYSTEM_MODE(MANUAL);        

SYSTEM_THREAD(ENABLED);         //  uncomment to activate   

void setup() {
  // These two lines are here so you can see the debug logs. You probably
  // don't want them in your code.
  waitFor(Serial.isConnected, 10000); // For testing purposes, wait 10 seconds before continuing to allow serial to connect
  delay(2000);                        // so the debug log messages can be read.

  // Log some messages with different logging levels
  Log.info("This is info message");
  Log.warn("This is warning message");
  Log.error("This is error message, error=%d", g_errCode);

  // Format text message
  //Log.info("System version: %s", (const char*)System.version());
  Log.info("System version: %s", System.version().c_str());
  delay(200);

  pinMode(D7, OUTPUT);//  built-in led
}

void loop() {

  digitalWrite(D7, HIGH); //  blink led
  delay(1000);
  digitalWrite(D7, LOW);
  delay(1000);

  //Particle.process(); //Uncomment if SYSTEM_MODE(MANUAL)  AND   NOT SYSTEM_THREAD(ENABLED)
}

same error

I guess your issue is due this:
issue

but I'm not familiar at all with VS and Particle Workbench
Here's some kind similar issue and a lot of info in one place, how to deal with Particle Workbench.

Hope this will help

The problem is almost certainly that your Windows username contains a space. This causes your home directory to contain a space, and the GNU toolchain (make, gcc-arm, etc.) do not work with directory names that contain spaces. This includes both your home directory name, as well as any subdirectories.

3 Likes

Thanks, I got it.

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