通过 Visual Studio 运行 GCC
我一直在编写一个应用程序来解析 Visual Studio 2010 解决方案并尝试使用 GCC 对其进行编译。
当我构建应用程序时,我让它在标准控制台窗口中运行,并且没有遇到任何问题(前提是您忽略我轻微的 GCC 不兼容性;))。
问题来了,当我在 Visual Studio 下执行这个应用程序时,它启动得很好,但是当它生成 GCC 子进程时,它会报告:
cc1plus.exe:加载共享库时出错:?:无法打开共享对象文件:没有这样的文件或目录
这非常令人困惑,因为它作为独立控制台应用程序运行良好。那么有人知道发生了什么事吗?这个“?”是什么?图书馆?为什么在控制台下可以运行,但通过VStudio就不行?
我从构建应用程序内部转储我的 PATH 环境变量,它肯定包含我的 cygwin/bin 目录。之后它会立即丢失吗?如果我运行 cygwin bash shell,则 /usr/bin 位于路径中。
那么什么给出呢?有人有什么想法吗?
I have been writing an app that parses a Visual Studio 2010 solution and attempts to compile it using GCC.
As I built the app I have had it running in a standard console window and I have had no problems (provided you ignore my slight GCC incompatibilities ;)).
The problem comes that when I execute this application under Visual Studio it fires up fine but when it spawns the GCC child processes it reports:
cc1plus.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory
This is very confusing as it works fine as a standalone console app. So has anyone idea what is going on? What is this "?" library? Why does it work under the console but not through VStudio?
I dump my PATH env var from inside the build app and it definitely includes my cygwin/bin directory. Does it get lost immediately after this? If I run the cygwin bash shell then /usr/bin is in the path.
So what gives? Has anyone got any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我还没有在 Visual Studio 中尝试过这个问题,我不确定这是否能解决您的问题,但在尝试使用 emacs 在 Windows 中使用 cygwin 的 gcc 编译程序时遇到了类似的问题。因为 cygwin 的 gcc.exe 不是可执行文件,而是实际可执行文件的一种符号链接(根据您安装的内容,可以是 gcc-3.exe 或 gcc-4.exe)。在 BASH shell 中,这些符号链接很容易解析,但在 cmd.exe 中则不然。
I haven't tried this problem with visual studio and I am not sure if this solves your problem, but faced a similar issue when trying to compile a program with cygwin's gcc in windows with emacs. Siince cygwin's gcc.exe is not an executable, but a type of symlink to the actual executable (which is either gcc-3.exe or gcc-4.exe depending on what you have installed). In the BASH shell these symlinks are easily resolved, in cmd.exe they are not.
运行 SysInternals ProcMon 并查看哪些文件无法加载?
Run SysInternals ProcMon and see what files are failing to load?