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++ 编译
基础教程推荐
- 如何定义双括号/双迭代器运算符,类似于向量的向量? 2022-01-01
- 什么是T&&(双与号)在 C++11 中是什么意思? 2022-11-04
- 运算符重载的基本规则和习语是什么? 2022-10-31
- 设计字符串本地化的最佳方法 2022-01-01
- C++,'if' 表达式中的变量声明 2021-01-01
- 如何在 C++ 中处理或避免堆栈溢出 2022-01-01
- C++ 程序在执行 std::string 分配时总是崩溃 2022-01-01
- 您如何将 CreateThread 用于属于类成员的函数? 2021-01-01
- C++ 标准:取消引用 NULL 指针以获取引用? 2021-01-01
- 调用std::Package_TASK::Get_Future()时可能出现争用情况 2022-12-17