Get quot;Access is deniedquot; when trying to compile with g++ from command line. Cygwin(获取“访问被拒绝尝试从命令行使用 g++ 编译时.赛格温)
问题描述
我已经在 cygwin 中安装了所有软件包.我还将 C:cygwinin 添加到我的 PATH 变量中.但是当我尝试在命令行中编译一个 c++ 文件时,我收到错误访问被拒绝".相同的命令在 cygwin 批处理窗口中工作.有谁知道怎么回事?
I have installed all packages in cygwin. I have also added C:cygwinin to my PATH variable. But when I try to compile a c++ file in command line I get the error 'Access is denied'. The same commands work in the cygwin batch window. Does anyone know what's wrong?
我更改了 gcc 和 g++ 的权限.我不再收到拒绝访问"错误,而是收到一个新错误:此版本的 C:cygwining++.exe 与您正在运行的 Windows 版本不兼容.请检查您计算机的系统信息以看看您是否需要 x86(32 位)或 x64(64 位)版本的程序,然后联系软件发行商.".
I changed the permissions for gcc and g++. I no longer get the 'Access Denied' error, but get a new one: "This version of C:cygwining++.exe is not compatible with the version of Windows you're running. Check your computer's system information to see whether you need a x86 (32-bit) or x64 (64-bit) version of the program, and then contact the software publisher.".
推荐答案
因为c:cygwiningcc.exe不是可执行文件,所以是cygwin符号链接.
p>
Because c:cygwiningcc.exe
isn't an executable file, it's a cygwin symbolic link.
$ file /bin/gcc
/bin/gcc: symbolic link to `/etc/alternatives/gcc'
$ file /etc/alternatives/gcc
/etc/alternatives/gcc: symbolic link to `/usr/bin/gcc-4.exe'
底层文件运行良好.
C:cygwinhomeBen>gcc-4 --version
gcc-4 (GCC) 4.5.0
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
这篇关于获取“访问被拒绝"尝试从命令行使用 g++ 编译时.赛格温的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:获取“访问被拒绝"尝试从命令行使用 g++ 编译


- XML Schema 到 C++ 类 2022-01-01
- 使用 __stdcall & 调用 DLLVS2013 中的 GetProcAddress() 2021-01-01
- GDB 不显示函数名 2022-01-01
- 将函数的返回值分配给引用 C++? 2022-01-01
- 哪个更快:if (bool) 或 if(int)? 2022-01-01
- DoEvents 等效于 C++? 2021-01-01
- 如何提取 __VA_ARGS__? 2022-01-01
- 将 hdc 内容复制到位图 2022-09-04
- 从父 CMakeLists.txt 覆盖 CMake 中的默认选项(...)值 2021-01-01
- OpenGL 对象的 RAII 包装器 2021-01-01