Skip to content

Library path issues with old compilers #259

Open
@alvieboy

Description

@alvieboy

I am currently using an old GCC compiler (gcc 3.4.2) and I am having issues with library detection.

Under "findIncludeForOldCompilers" the current code searches for "fatal error" which is not output by this compiler. Example for SPI library include:

gcc3.4.2 (not working):
/home/alvieboy/sketchbook/tft/tft.ino:1:17: SPI.h: No such file or directory
gcc4.8.2 (different platform, working)
/home/alvieboy/sketchbook/tft/tft.ino:1:17: fatal error: SPI.h: No such file or directory

This causes my system not to include any library due to match failure. The folllowing code fixes it, but is awkward, and may not work with localization enabled.

I cannot upgrade compiler as of now. Perhaps there's a better way to filter out the includes ?

+++ b/src/arduino.cc/builder/includes_finder_with_regexp.go
@@ -62,6 +62,9 @@ func findIncludeForOldCompilers(source string) string {
                        if strings.Contains(splittedLine[i], "fatal error") {
                                return strings.TrimSpace(splittedLine[i+1])
                        }`
+                       if strings.Contains(splittedLine[i], "No such file") {
+                               return strings.TrimSpace(splittedLine[i-1])
+                       }
                }
        }
        return ""

arduino-builder: git 03d0da6

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: codeRelated to content of the project itselftype: imperfectionPerceived defect in any part of project

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions