[Scons-users] PlatformIO: Compilation bug on Windows with installed MSVC

Ivan Kravets me at ikravets.com
Sat Dec 13 15:49:11 EST 2014

> On Dec 13, 2014, at 22:29, Dirk Bächle <tshortik at gmx.de> wrote:
> Ivan,
> On 13.12.2014 20:17, Ivan Kravets wrote:
>> Hi Dirk,
>>> On Dec 11, 2014, at 02:03, Dirk Bächle <tshortik at gmx.de> wrote:
>>> Hi Ivan,
>>> On 10.12.2014 23:07, Ivan Kravets wrote:
>>>> Dear developers,
>>>> I have an issue with PlatformIO project: https://github.com/ivankravets/platformio/issues/18
>>>> Can anyone me explain how to avoid this strange "code line"?
>>>> tools=["default", "gcc", "g++", "ar", "gnulink", "platformio"]
>>> telling SCons "tools=default" means that it will go off and try to find and initialize any C/C++/LaTeX/SWIG/... compiler in the current system. The first match wins and gets picked. The order in which different tools/compilers are probed is currently fixed per platform (Win/linux/darwin/sunos)...and under Windows it will always select the VisualStudio compiler first, and initialize the flag prefixes and suffixes (like for include paths) accordingly.
>>> If you know exactly which compiler you need, just leave out the "default"...and set the PATH variable for your build environment, such that the executable can be found when the Tool checks that it really exists.
>> Thanks a lot for quick answer!
>> I set -> tools=["platformio"] and received  -> AttributeError: 'SConsEnvironment' object has no attribute 'Library'
>> As I understand, I can't avoid "default" tool, because it contains all logic with "Program", "Library" and etc.
> the "default" option tries to load everything it finds, so you end up with an Environment that has all possible Builders attached...even those that you don't really need. If your "platformio" tool/package relies on the Builders "Library", "Program", and so on...you have to load the Builders that attach these methods to your environment of course.
> That's why a simple "tools=['platformio']" is not enough, you have to load "gcc", "g++", "ar", "gnulink" as well.
> Does this make things clearer for you?

This has looked a bit confusing to me, but now I got you! I looked into the sources:


and understood what do you mean under "g++", "gcc"... Sometimes, these abbreviations can have another meaning and using :)

Thanks a lot and have a nice weekend! :)

With best regards, Ivan Kravets
   - "Creativity comes from talent and never from knowledge" (c)

More information about the Scons-users mailing list