[Scons-users] Specify Toolchain for Windows

R0b0t1 r030t1 at gmail.com
Thu May 18 12:23:27 EDT 2017


On Thu, May 18, 2017 at 1:10 AM, Steve - Gadget Barnes
<gadgetsteve at hotmail.com> wrote:
> On Wed, May 17, 2017 at 9:15 AM, R0b0t1 <r030t1 at gmail.com> wrote:
>
>  > On Tue, May 16, 2017 at 10:24 PM, Bill Deegan <bill at baddogconsulting.com>
>  > wrote:
>  >> By the time you set PATH, the mingw tool has already initialized
> with the
>  >> default path.
>  >>
>  >> Try this:
>  >>
>  >> path = ['C:\MinGW\x86_64-6.3.0-posix-seh-rt_v5-rev2\mingw64\bin']
>  >>
>  >> env = Environment(tools=['])
>  >> env.PrependENVPath('PATH',path)
>  >> env.Tool('default')
>  >> shooter = env.Program(target=target, source=sources,
>  >>                   LIBS=libraries, CPPPATH=incpath, LIBPATH=libpath)
>  >>
>  >
>  > Thanks Bill, but that still may not be early enough. Also I think
>  > there may be issues with Unicode support even in the Python 2.7
>  > version of SCons but I was able to work around them for now.
>  >
>  > ```Python
>  > path = [unicode('C:\MinGW\x86_64-6.3.0-posix-seh-rt_v5-rev2\mingw64\bin',
>  > errors='ignore')]
>  >
>  > environ = Environment(tools=[])
>  > environ.PrependENVPath('PATH', path)
>  > environ.Tool('default')
>  > ```
>  >
>  > I receive the same MinGW linker message where it tried to use the 32
>  > bit toolchain.
>  > _______________________________________________
>  > Scons-users mailing list
>  > Scons-users at scons.org
>  > https://pairlist4.pair.net/mailman/listinfo/scons-users
>  >
>
> The big problem is that you are specifying paths as
> 'C:\MinGW\x86_64-6.3.0-posix-seh-rt_v5-rev2\mingw64\bin' rather than any of:
>
>   - r'C:\MinGW\x86_64-6.3.0-posix-seh-rt_v5-rev2\mingw64\bin'
>   - 'C:\\MinGW\\x86_64-6.3.0-posix-seh-rt_v5-rev2\\mingw64\\bin'
>   - 'C:/MinGW/x86_64-6.3.0-posix-seh-rt_v5-rev2/mingw64/bin'
>
> So \x86 for example is being treated as a hex character with a value of
> 0x86.
>

Now *that* explains it. I thought it was something silly but didn't catch on.

I now have:

```Python
path = ['C:/MinGW/x86_64-6.3.0-posix-seh-rt_v5-rev2/mingw64/bin']

environ = Environment(tools=[])
environ.PrependENVPath('PATH', path)
environ.Tool('default')

shooter = environ.Program(target=target, source=sources,
    PATH=path, LIBS=libraries, CPPPATH=incpath, LIBPATH=libpath)
```

But still receive:

```
c:/mingw/bin/../lib/gcc/mingw32/5.3.0/../../../libmingw32.a(main.o):
(.text.startup+0xa0): undefined reference to `WinMain at 16'
collect2.exe: error: ld returned 1 exit status
scons: *** [shooter.exe] Error 1
```


More information about the Scons-users mailing list