简体   繁体   English

通过Visual Studio运行GCC

[英]Running GCC through Visual studio

I have been writing an app that parses a Visual Studio 2010 solution and attempts to compile it using GCC. 我一直在编写一个解析Visual Studio 2010解决方案并尝试使用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 ;)). 当我构建应用程序时,我已经在标准控制台窗口中运行它并且我没有遇到任何问题(假设您忽略了我的轻微GCC不兼容性;))。

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: 问题是,当我在Visual Studio下执行此应用程序时,它会正常启动,但是当它生成GCC子进程时,它会报告:

cc1plus.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory cc1plus.exe:加载共享库时出错:?:无法打开共享对象文件:没有这样的文件或目录

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? 为什么它在控制台下工作,而不是通过VStudio?

I dump my PATH env var from inside the build app and it definitely includes my cygwin/bin directory. 我从构建应用程序中转储我的PATH env var,它肯定包含我的cygwin / bin目录。 Does it get lost immediately after this? 这之后会立刻迷路吗? If I run the cygwin bash shell then /usr/bin is in the path. 如果我运行cygwin bash shell,那么/ usr / bin就在路径中。

So what gives? 什么给出了什么? Has anyone got any ideas? 有没有人有任何想法?

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. 我没有尝试使用visual studio这个问题,我不确定这是否解决了你的问题,但在尝试使用emacs在windows中使用cygwin的gcc编译程序时遇到了类似的问题。 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). Siince cygwin的gcc.exe不是可执行文件,而是实际可执行文件的一种符号链接(根据你安装的内容,它是gcc-3.exe或gcc-4.exe)。 In the BASH shell these symlinks are easily resolved, in cmd.exe they are not. 在BASH shell中,这些符号链接很容易解析,在cmd.exe中它们不是。

运行SysInternals ProcMon并查看哪些文件无法加载?

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

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