4 Replies Latest reply on Sep 19, 2014 5:20 PM by Intel_Alvarado

    galileo-vista-error stray '\'  compiling errorprogram

    bjkellett

      Help.   I always seem to get this stray \ problem when compiling.  In this case I'm trying to get the internet going on the galileo with the examples in the intel Do-It-Yourself Challenge

      Networking by Nicolas Vailliet.  I guess this is that problem with translating the windows file path.  I was able to get the first program of this do-it-yourself to compile.

       

      char output[500];

      void setup(){

        Serial.begin(9600);

      }

      void loop(){

        system(“ifconfig > log.txt”);

        FILE *fp;

        fp = fopen(“log.txt”,”r”);

        while(fgets(output,500,fp) != NULL)

          Serial.println(output);

        fclose(fp);

        delay(5000);

      }

       

       

      C:\galileo/hardware/tools/x86/i686-pokysdk-mingw32/usr/bin/i586-poky-linux-uclibc/i586-poky-linux-uclibc-g++ -m32 -march=i586 --sysroot=C:\galileo/hardware/tools/x86/i586-poky-linux-uclibc -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -MMD -D__ARDUINO_X86__ -march=i586 -m32 -DARDUINO=153 -IC:\galileo\hardware\arduino\x86\cores\arduino -IC:\galileo\hardware\arduino\x86\variants\galileo_fab_d C:\Users\Bruce\AppData\Local\Temp\build6654907849584173208.tmp\galileoether2.cpp -o C:\Users\Bruce\AppData\Local\Temp\build6654907849584173208.tmp\galileoether2.cpp.o

      galileoether2.ino:6:3: error: stray '\' in program

      galileoether2.ino:6:3: error: stray '\' in program

      galileoether2.ino:8:3: error: stray '\' in program

      galileoether2.ino:8:3: error: stray '\' in program

      galileoether2.ino:8:3: error: stray '\' in program

      galileoether2.ino:8:3: error: stray '\' in program

      galileoether2.ino: In function 'void loop()':

      galileoether2.ino:6:11: error: 'u201cifconfig' was not declared in this scopeH

      galileoether2.ino:6:31: error: request for member 'txt' in 'log', which is of non-class type 'double(double)throw ()'

      galileoether2.ino:8:15: error: 'u201clog' was not declared in this scope

      galileoether2.ino:8:35: error: 'u201dr' was not declared in this scope

        • 1. Re: galileo-vista-error stray '\'  compiling errorprogram
          Intel_Alvarado

          Hi bjkellett,

           

          I believe the problem might be in the fopen function.

          Try changing the line “  fp = fopen(“log.txt”,”r”);” for the line “fp=fopen("c:\\log.txt", "r");”

          Let me know if this helps.

           

          Regards

          Intel_Alvarado

          • 2. Re: galileo-vista-error stray '\'  compiling errorprogram
            bjkellett

            Hi Intel_Alvarado;

             

            As you suggested I tried this;

             

            char output[500];

            void setup(){

              Serial.begin(9600);

            }

            void loop(){

              system(“ifconfig > log.txt”);

              FILE *fp;

              fp = fopen(“c:\\log.txt”,”r”);

              while(fgets(output,500,fp) != NULL)

                Serial.println(output);

              fclose(fp);

              delay(5000);

            }

             

            and got this error message (which looks like the same file path issues with windows);

             

            C:\galileo/hardware/tools/x86/i686-pokysdk-mingw32/usr/bin/i586-poky-linux-uclibc/i586-poky-linux-uclibc-g++ -m32 -march=i586 --sysroot=C:\galileo/hardware/tools/x86/i586-poky-linux-uclibc -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -MMD -D__ARDUINO_X86__ -march=i586 -m32 -DARDUINO=153 -IC:\galileo\hardware\arduino\x86\cores\arduino -IC:\galileo\hardware\arduino\x86\variants\galileo_fab_d C:\Users\Bruce\AppData\Local\Temp\build5575586412294002213.tmp\galileoether3.cpp -o C:\Users\Bruce\AppData\Local\Temp\build5575586412294002213.tmp\galileoether3.cpp.o

            galileoether3.ino:6:3: error: stray '\' in program

            galileoether3.ino:6:3: error: stray '\' in program

            galileoether3.ino:8:3: error: stray '\' in program

            galileoether3.ino:8:3: error: stray '\' in program

            galileoether3.ino:8:3: error: stray '\' in program

            galileoether3.ino:8:3: error: stray '\' in program

            galileoether3.ino:8:3: error: stray '\' in program

            galileoether3.ino:8:3: error: stray '\' in program

            galileoether3.ino: In function 'void loop()':

            galileoether3.ino:6:11: error: 'u201cifconfig' was not declared in this scope

            galileoether3.ino:6:31: error: request for member 'txt' in 'log', which is of non-class type 'double(double)throw ()'

            galileoether3.ino:8:21: error: found ':' in nested-name-specifier, expected '::'

            galileoether3.ino:8:15: error: 'u201cc' has not been declared

            galileoether3.ino:8:39: error: 'u201dr' was not declared in this scope

            • 3. Re: galileo-vista-error stray '\'  compiling errorprogram
              Intel_Alvarado

              Hi bjkellett,

               

              Just to confirm that you have an IP address set on your board, can you run the ifconfig command in the Linux console. You should see it as “inet addr” under the eth0 interface.

               

              Regards

              Sergio

              • 4. Re: galileo-vista-error stray '\'  compiling errorprogram
                Intel_Alvarado

                Hi

                We are following up on your post galileo-vista-error stray '\'  compiling errorprogram and we would like to know if you still need help or if you already have an answer or solution to your question. Remember if someone replied to you with a helpful response you can mark it as correct or helpful answered. We will be waiting your response. Have a great day.
                Regards,

                Sergio