简体   繁体   English

在路径中有 mingw32 和 mingw64 - 可以吗?

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

quick question: is it safe to have both ming32 and ming64 runtimes in path?快速提问:在路径中同时使用 ming32 和 ming64 运行时是否安全?

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.由于它们是 32 对 64,我猜想 dll 在两种情况下都不会发生冲突和正确解决,但也许我遗漏了一些东西。

FYI: It works in fact on my computer, I am just not sure about the theory.仅供参考:它实际上在我的电脑上有效,我只是不确定理论。

The rule is simple, Win will locate:规则很简单, Win会定位到:

  • Executables (when not launched with full path)可执行文件(未使用完整路径启动时)
  • DLL s (loaded (recursively) by executables) DLL (由可执行文件加载(递归))

in the directories from %PATH% that come first.在首先出现的%PATH%目录中。

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). MinGW版本是独立的(不依赖于另一个),所以如果它的所有dir都在%PATH%中,它将被自动选择,并且第二个版本将被忽略,因此它存在于%PATH %是无用的(实际上,当操作系统也会搜索那些dir时,它会增加额外的开销)。
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 .但是,如果 2 个版本中的dir 被交错插入(一些 dir来自第 1版本,一些来自第 2版本,一些其他dir来自第 1版本,...),那么您可能(并且很可能会)遇到麻烦,所以不要这样做

I guess you need both variants to generate 064bit and 032bit binaries.我猜你需要两种变体来生成064bit032bit二进制文件。 But doesn't GCC 's -m32 argument work?但是GCC-m32参数不起作用吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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