cygwin编译c++程序不成功

Mr. Code 2015-08-08 05:56:43
源代码:

#include <iostream>
#include <stdio.h>
using namespace std;

int main() {
cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!!
return 0;
}

在cygwin下编译,

$ g++ -I"E:\cygwin64/lib/gcc/i686-pc-cygwin/4.9.2/include/c++" -I"E:\cygwin64/lib/gcc/i686-pc-cygwin/4.9.2/include/c++/i686-pc-cygwin" -I"E:\cygwin64/lib/gcc/i686-pc-cygwin/4.9.2/include/c++/backward" -I"E:\cygwin64/lib/gcc/i686-pc-cygwin/4.9.2/include" -I"E:\cygwin64/lib/gcc/i686-pc-cygwin/4.9.2/include-fixed" -I"E:\cygwin64/usr/include" -I"E:\cygwin64/usr/include/w32api" -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/hello1.d" -MT"src/hello1.d" -o "src/hello1.o" "../src/hello1.cpp"
E:/cygwin64/lib/gcc/x86_64-pc-cygwin/4.9.3/cc1plus.exe: error while loading shared libraries: cygisl-10.dll: cannot open shared object file: No such file or directory

出现error while loading shared libraries: cygisl-10.dll: cannot open shared object file: No such file or directory错误,搜索cygisl-10.dll文件,在E:\cygwin64\usr\i686-pc-cygwin\sys-root\usr\bin中找到,增加
-L"E:\cygwin64\usr\i686-pc-cygwin\sys-root\usr\bin"
错误依然。
求解决方法。
...全文
398 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
Mr. Code 2015-08-09
  • 打赏
  • 举报
回复
我把E:\cygwin64\usr\i686-pc-cygwin\sys-root\usr\bin这个目录放到了PATH环境变量下,没有这个错误了,但是还有另一个错误,

make all 
Building file: ../src/hello1.cpp
Invoking: Cygwin C++ Compiler
g++ -I"E:\cygwin64/lib/gcc/i686-pc-cygwin/4.9.2/include/c++" -I"E:\cygwin64/lib/gcc/i686-pc-cygwin/4.9.2/include/c++/i686-pc-cygwin" -I"E:\cygwin64/lib/gcc/i686-pc-cygwin/4.9.2/include/c++/backward" -I"E:\cygwin64/lib/gcc/i686-pc-cygwin/4.9.2/include" -I"E:\cygwin64/lib/gcc/i686-pc-cygwin/4.9.2/include-fixed" -I"E:\cygwin64/usr/include" -I"E:\cygwin64/usr/include/w32api" -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/hello1.d" -MT"src/hello1.d" -o "src/hello1.o" "../src/hello1.cpp"
src/subdir.mk:18: recipe for target 'src/hello1.o' failed
make: *** [src/hello1.o] Error 1
我搜索了一下hello1.o没有,hello1.obj就有,但是文件不让编辑,编辑了,一build又变了回来,怎么办? subdir.mk是eclipse自己产生的。如下:

################################################################################
# Automatically-generated file. Do not edit!
################################################################################

# Add inputs and outputs from these tool invocations to the build variables 
CPP_SRCS += \
../src/hello1.cpp 

OBJS += \
./src/hello1.o 

CPP_DEPS += \
./src/hello1.d 


# Each subdirectory must supply rules for building sources it contributes
src/%.o: ../src/%.cpp
	@echo 'Building file: $<'
	@echo 'Invoking: Cygwin C++ Compiler'
	g++ -I"E:\cygwin64/lib/gcc/i686-pc-cygwin/4.9.2/include/c++" -I"E:\cygwin64/lib/gcc/i686-pc-cygwin/4.9.2/include/c++/i686-pc-cygwin" -I"E:\cygwin64/lib/gcc/i686-pc-cygwin/4.9.2/include/c++/backward" -I"E:\cygwin64/lib/gcc/i686-pc-cygwin/4.9.2/include" -I"E:\cygwin64/lib/gcc/i686-pc-cygwin/4.9.2/include-fixed" -I"E:\cygwin64/usr/include" -I"E:\cygwin64/usr/include/w32api" -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
	@echo 'Finished building: $<'
	@echo ' '
「已注销」 2015-08-09
  • 打赏
  • 举报
回复
放到相同目录下
瑞星对Loader_CppIDE.exe报错,NOD32对CppIDE.exe报错,金山毒霸2011,360杀毒,卡巴均能通过。 更新说明: 1.去除原英文版中附带的病毒。 2.集合了破解补丁Loader_CppIDE.exe和汉化补丁,重新打包。 3.补充上一版本未汉化的地方,修正汉化不合理的地方。 4.设置Loader_CppIDE.exe为主程序,默认以Loader_CppIDE.exe运行。 5.默认简体中文。 6.C-Free 5 的帮助和库函数参考由英文改为中文。 7.在桌面自动创建Loader_CppIDE.exe的快捷方式。 8.修改了其他的一些细节,自行体会。 C-Free是一款支持多种编译器的专业化C/C++集成开发环境(IDE)。利用本软件,使用者可以轻松地编辑、编译、连接、运行、调试C/C++程序。C-Free 4 较之前的版本有巨大改进,主要有以下特性:(主窗口) 1. 支持多编译器,可以配置添加其他编译器;(0) 目前支持的编译器类型: (1) MinGW 2.95/3.x/4.x/5.0 (2) Cygwin (3) Borland C++ Compiler (4) Microsoft C++ Compiler (5) Open Watcom C/C++ (6) Digital Mars C/C++ (7) Ch Interpreter 2. 增强的C/C++语法加亮器,(可加亮函数名,类型名,常量名等);(1) 3. 增强的智能输入功能;(2) 3. 可添加语言加亮器,支持其他编程语言; 4. 可添加工程类型,可定制其他的工程向导;(3) 5. 完善的代码定位功能(查找声明、实现和引用);(4) 7. 代码完成功能和函数参数提示功能;(5)(6) 8. 能够列出代码文件中包含的所有符号(函数、类/结构、变量等);(7) 9. 大量可定制的功能 可定制快捷键 可定制外部工具 可定制帮助(可支持Windows帮助、Html帮助和在线帮助); 10. 彩色、带语法加亮打印功能; 11. 在调试时显示控制台窗口;(8) 12. 工程转化功能,可将其他类型的工程转化为C-Free格式的工程,并在C-Free中打开。 CJY 2010年5月7日

18,772

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 专题技术讨论区
社区管理员
  • 专题技术讨论区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧