简体   繁体   中英

having both mingw32 and mingw64 in path - is it ok?

quick question: is it safe to have both ming32 and ming64 runtimes in path?

As they are 32 vs. 64 I would guess dlls would not clash and properly resolved in both cased, but maybe I am missing something.

FYI: It works in fact on my computer, I am just not sure about the theory.

The rule is simple, Win will locate:

  • Executables (when not launched with full path)
  • DLL s (loaded (recursively) by executables)

in the directories from %PATH% that come first.

References:

A MinGW version is stand alone (doesn't depend on the other), so if all its dir s are in %PATH% , it will be chosen automatically, and the 2 nd version is simply going be ignored therefore its presence in %PATH% is useless (actually, it will add additional overhead when the OS will search those dir s too).
However , if dir s from the 2 versions are inserted interleavedly (some dir s from 1 st version, some from 2 nd version, some other dir s from 1 st version, ...), then you might (and most likely will) get in trouble, so don't do it .

I guess you need both variants to generate 064bit and 032bit binaries. But doesn't GCC 's -m32 argument work?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM