0223 uniwin eclipse cdt gcc cygwin 3 ftp
0223 uniwin eclipse cdt gcc cygwin 1
http://www.yippeesoft.com/blog/p/0223uniwineclipsecdtgcccygwin1.php
0223 uniwin eclipse cdt gcc cygwin 2
http://www.yippeesoft.com/blog/p/0223uniwineclipsecdtgcccygwin2.php
终于发现问题所在:
我在LINUX下面直接运行也是如此:
[sf@mobile Debug]$ g++ -O0 -g3 -Wall -c -fmessage-length=0 -otttt.o ../tttt.cpp
[sf@mobile Debug]$ g++ -otttt.exe ./tttt.o
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../../crt1.o(.text+0×18): In function `_start\’:
../sysdeps/i386/elf/start.S:77: undefined reference to `main\’
collect2: ld returned 1 exit status
仔细一看:
总用量 4
drwxr-xr-x 2 sf root 4096 2月 23 12:40 Debug
-rw-r–r– 1 sf root 0 2月 23 09:21 t.c
-rw-r–r– 1 sf root 0 2月 23 12:22 tttt.cpp
文件居然都是空的?!
所以虽然编译出来
总用量 4
-rw-r–r– 1 sf root 1992 2月 23 12:40 tttt.o
但是没有办法连接了
但是看看UNIWIN的LOG,应该没有什么问题啊
local: O:/java/eclipse/works/tttt/tttt.cpp
==> remote: /home/sf/tttt/tttt.cpp
local: O:/java/eclipse/works/tttt/tttt.cpp
==> remote: /home/sf/tttt/tttt.cpp
没有报告什么
=> no operation taken.
之类的,真是非常奇怪~~~~~
然后在LINUX下面VI复制代码。直接编译出来A.OUT,运行OK,再用ECLIPSE编译
Building file: ../tttt.cpp
Invoking: GCC C++ Compiler
O:/java/eclipse/Uniwin/bin/g++ -O0 -g3 -Wall -c -fmessage-length=0 -otttt.o ../tttt.cpp
Finished building: ../tttt.cpp
Building target: tttt.exe
Invoking: GCC C++ Linker
O:/java/eclipse/Uniwin/bin/g++ -otttt.exe ./tttt.o
Finished building target: tttt.exe
Build complete for project tttt
非常OK
0223 uniwin eclipse cdt gcc cygwin 4 ftp
代码:以前玩嵌入式LINUX交叉编译的
#include <stdio.h>
int main(void)
&leftsign;
int i;
for(i = 0; i < 6; i++)&leftsign;
printf("i = %d ",i);
printf("Hello, embedded linux!\\n");
&rightsign;
return 0;
&rightsign;
输出很正常
./tttt
i = 0 Hello, embedded linux!
i = 1 Hello, embedded linux!
i = 2 Hello, embedded linux!
i = 3 Hello, embedded linux!
i = 4 Hello, embedded linux!
i = 5 Hello, embedded linux!
可是我修改了一下循环次数,编译又出现
**** Incremental build of configuration Debug for project tttt ****
make -k all
Building file: ../tttt.cpp
Invoking: GCC C++ Compiler
O:/java/eclipse/Uniwin/bin/g++ -O0 -g3 -Wall -c -fmessage-length=0 -otttt.o ../tttt.cpp
Finished building: ../tttt.cpp
Building target: tttt.exe
Invoking: GCC C++ Linker
O:/java/eclipse/Uniwin/bin/g++ -otttt.exe ./tttt.o
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../../crt1.o(.text+0×18): In function `_start\’:
../sysdeps/i386/elf/start.S:77: undefined reference to `main\’
collect2: ld returned 1 exit status
Finished building target: tttt.exe
Build complete for project tttt
再一看LINUX下面文件
总用量 4
drwxr-xr-x 2 sf root 4096 2月 23 12:50 Debug
-rw-r–r– 1 sf root 0 2月 23 09:21 t.c
-rw-r–r– 1 sf root 0 2月 23 12:49 tttt.cpp
又为0字节了,我怀疑是FTP失败,创建了新文件,但是没有能够传输字节上去
标签:cdt, cli, cygwin, eclipse, ftp, gcc, uniwin, win0223 uniwin eclipse cdt gcc cygwin 2
0223 uniwin eclipse cdt gcc cygwin 1
http://www.yippeesoft.com/blog/p/0223uniwineclipsecdtgcccygwin1.php
0223 uniwin eclipse cdt gcc cygwin 3 ftp (2006-6-14)
0223 uniwin eclipse cdt gcc cygwin 4 ftp (2006-6-13)
原来老是习惯性按下 确定,把UNIWIN关了,打开之后再 BUILD 结果
Building file: ../tttt.cpp
Invoking: GCC C++ Compiler
O:/java/eclipse/Uniwin/bin/gcc -O0 -g3 -Wall -c -fmessage-length=0 -otttt.o ../tttt.cpp
gcc: ../tttt.cpp: 没有那个文件或目录
gcc: no input files
Finished building: ../tttt.cpp
Building target: tttt.exe
Invoking: GCC C++ Linker
g++ -otttt.exe ./tttt.o
/bin/../lib/gcc-lib/i686-pc-cygwin/3.3.3/../../../libcygwin.a(libcmain.o)(.text+0xb3): undefined reference to `_WinMain@16\’
collect2: ld returned 1 exit status
make: *** [tttt.exe] Error 1
make: Target `all\’ not remade because of errors.
Build complete for project tttt
看来是文件没有上传上去,按照作者说的,随便加了一个空格,保存,现在LINUX下面有了。
Building file: ../tttt.cpp
Invoking: GCC C++ Compiler
O:/java/eclipse/Uniwin/bin/gcc -O0 -g3 -Wall -c -fmessage-length=0 -otttt.o ../tttt.cpp
Finished building: ../tttt.cpp
Building target: tttt.exe
Invoking: GCC C++ Linker
g++ -otttt.exe ./tttt.o
/bin/../lib/gcc-lib/i686-pc-cygwin/3.3.3/../../../libcygwin.a(libcmain.o)(.text+0xb3): undefined reference to `_WinMain@16\’
collect2: ld returned 1 exit status
make: *** [tttt.exe] Error 1
make: Target `all\’ not remade because of errors.
Build complete for project tttt
继续修改BUILDER LINK 选项
**** Full rebuild of configuration Debug for project tttt ****
make -k clean all
rm -rf ./tttt.o ./tttt.d tttt.exe
Building file: ../tttt.cpp
Invoking: GCC C++ Compiler
O:/java/eclipse/Uniwin/bin/gcc -O0 -g3 -Wall -c -fmessage-length=0 -otttt.o ../tttt.cpp
Finished building: ../tttt.cpp
Building target: tttt.exe
Invoking: GCC C++ Linker
O:/java/eclipse/Uniwin/bin/gcc -otttt.exe ./tttt.o
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../../crt1.o(.text+0×18): In function `_start\’:
../sysdeps/i386/elf/start.S:77: undefined reference to `main\’
collect2: ld returned 1 exit status
Finished building target: tttt.exe
Build complete for project tttt
0223 uniwin eclipse cdt gcc cygwin 1
作者很强:升级很快
我还是装了一个vmware + linux测试了一下telnet/ftp组合,把最后的在我这边跑的很happy的放到一个叫02_22_2006的patch里面了。
于是今天继续试用:
作者说:
只要%path of uniwin%/uniwin/bin在PATH环境变量最前面,eclipse缺省调用gcc, 就会调用uniwin/bin/目录下的gcc。这块不用设置。
结果:
这是XP设置用户变量
O:\\微软\\VS6\\Common\\Tools\\WinNT;O:\\微软\\VS6\\Common\\MSDev98\\Bin;O:\\微软\\VS6\\Common\\Tools;O:\\微软\\VS6\\VC98\\bin;N:\\share\\UltraEdit-32;O:\\ms\\xpsdk\\Bin\\.;O:\\ms\\xpsdk\\Bin\\WinNT\\;
全局变量
O:\\java\\eclipse\\Uniwin\\bin;%SystemRoot%\\system32;%SystemRoot%;%SystemRoot%\\system32\\WBEM;F:\\Program Files\\Common Files\\GTK\\2.0\\bin;F:\\WINXP\\Microsoft.Net\\Framework\\v1.1.4322;O:\\ms\\xpsdk\\Bin\\.;O:\\ms\\xpsdk\\Bin\\WinNT\\.;F:\\Program Files\\Microsoft SQL Server\\90\\Tools\\binn\\;F:\\Program Files\\Subversion\\bin
这是DOS下变量
Path=O:\\java\\eclipse\\Uniwin\\bin;F:\\WINXP\\system32;F:\\WINXP;F:\\WINXP\\system32\\WBEM;F:\\Program Files\\Common Files\\GTK\\2.0\\bin;F:\\WINXP\\Microsoft.Net\\Framework\\v1.1.4322;O:\\ms\\xpsdk\\Bin\\.;O:\\ms\\xpsdk\\Bin\\WinNT\\.;F:\\Program Files\\Microsoft SQLServer\\90\\Tools\\binn\\;F:\\Program Files\\Subversion\\bin;O:\\微软\\VS6\\Common\\Tools\\WinNT;O:\\微软\\VS6\\Common\\MSDev98\\Bin;O:\\微软\\VS6\\Common\\Tools;O:\\微软\\VS6\\VC98\\bin;N:\\share\\UltraEdit-32;O:\\ms\\xpsdk\\Bin\\.;O:\\ms\\xpsdk\\Bin\\WinNT\\;O:\\java\\eclipse\\Uniwin\\bin;F:\\WINXP\\system32;F:\\WINXP;F:\\WINXP\\system32\\WBEM;F:\\Program Files\\Common Files\\GTK\\2.0\\bin;F:\\WINXP\\Microsoft.Net\\Framework\\v1.1.4322;O:\\ms\\xpsdk\\Bin\\.;O:\\ms\\xpsdk\\Bin\\WinNT\\.;F:\\Program Files\\Microsoft SQL Server\\90\\Tools\\binn\\;F:\\Program Files\\Subversion\\bin;N:\\TOOLS;N:\\TOOLS\\NC;"D:\\ProgramFiles\\MicrosoftSQLServer\\80\\Tools\\Binn\\"
可是到了ECLIPSE第一个变成 M:\\CYGWIN\\BIN
然后就报告
Severity Description Resource In Folder Location Creation Time Id
1 Error launching \’cygpath\’ command tttt 2006年2月23日 9:29:31 3
Severity Description Resource In Folder Location Creation Time Id
1 C/C++ Indexer Problem: Preprocessor Inclusion not found: stdio.h in file: O:\\java\\eclipse\\works\\tttt\\t.c on line: 1. t.c tttt line 1 2006年2月23日 9:35:20 4
作者提示:
我也碰到这个问题过,我在step by step里写了eclipse和cygwin紧紧绑定,使用uniwin的时候‘如果装了cygwin, 请不要装gcc & g++那部分’。
不知道把cygwin的原来的gcc, g++换个名字行不行,我装了cygwin, 但是不装gcc, g++是可以的。
或者在eclipse配置project的编译器把gcc指定到O:\\java\\eclipse\\Uniwin\\bin\\gcc我想应该行的
我修改了一下:
**** Full rebuild of configuration Debug for project tttt ****
make -k clean all
rm -rf ./tttt.o ./tttt.d tttt.exe
Building file: ../tttt.cpp
Invoking: GCC C++ Compiler
O:\\java\\eclipse\\Uniwin\\bin\\gcc -O0 -g3 -Wall -c -fmessage-length=0 -otttt.o ../tttt.cpp
O:javaeclipseUniwinbingcc: not found
make: *** [tttt.o] Error 127
make: Target `all\’ not remade because of errors.
Build complete for project tttt
修改 O:\\java\\eclipse\\Uniwin\\bin\\ 为 O:/java/eclipse/Uniwin/bin/ 结果
make -k clean all
rm -rf ./tttt.o ./tttt.d tttt.exe
Building file: ../tttt.cpp
Invoking: GCC C++ Compiler
O:/java/eclipse/Uniwin/bin/gcc -O0 -g3 -Wall -c -fmessage-length=0 -otttt.o ../tttt.cpp
Could not open file mapping object (2).
Running gserver first!
make: *** [tttt.o] Error 255
make: Target `all\’ not remade because of errors.
Build complete for project tttt
具体代码主要是参照上次的LINUX下SOCKET编程,不过今天弄得我很郁闷,我本意是用MAGIC C++ 配上CYGWIN,主要试验一下发送、接收数据,以及短消息实际发送。
关于MAGIC C++
不过我有个奇怪的问题,不论我是本机还是远端,一编译就是 makefile of .. is out of date,bo you want to regenerate makefile
LINUX下有没有类似 MSDN的编程手册?我总是习惯按下F1,可是没有什么帮助弹出。我是本机CYGWIN。
另外我同样一段代码,分别文件定义为.C就可以编译OK,.CPP编译就是不行。不知道为什么。
我的WATCH MEM 窗口总是显示不出来,现象是 我点击菜单,能够在右下看到一个小窗口闪烁了一下,然后就没有了
拖开 DEBUG 所在的那个窗口 WATCH MEM 就出现了
关于 MinGW Developer Studio:..\\et.cpp:5:20: netdb.h: No such file or directory
..\\et.cpp:7:25: netinet\\in.h: No such file or directory
..\\et.cpp:8:25: sys\\socket.h: No such file or directory 之类的错误
CYGWIN编译出来的EXE文件FTP上传到LINUX下运行:结果 -bash: ./sgip.exe: cannot execute binary file 只好再在LINUX手工编译
gcc -c -o socket.o -c -g socket.c
g++ -g -o sgip.exe socket.o
int str2bytes(char *str,byte *b)
&leftsign;
int i;
int j=0;
char stmp[3];
for(i=0;i<strlen(str);i++,j++)
&leftsign;
stmp[0]=str[i];
stmp[1]=str[i+1];
stmp[2]=\’\\0\’;
sscanf(stmp,"%x",&b[j]);
i=i+1;
&rightsign;
return 0;
&rightsign; 如此简单的一段代码,上午获得的BYTE数组乱七八糟,下午却又好了 :(
if ((recvbytes=recv(sockfd, buf, MAXDATASIZE, 0)) ==-1) 单步调试有时候出错,有时候又可以接收到数据。
在Visual C++中定制AppWizard (一) http://www.vckbase.com/document/viewdoc/?id=276
在Visual C++中定制AppWizard (二) http://www.vckbase.com/document/viewdoc/?id=286
在Visual C++中定制AppWizard (三)http://www.vckbase.com/document/viewdoc/?id=287
custom AppWizard 应该可以制作BECKY 插件 工程向导;DDK向导;如果可以用VC设置使用CYGWIN编译的话,也应该可以制作类似的向导
标签:cygwin, linux, win, 编程昨天好不容易装完了 Cygwin Bash Shell,结果当时想试验一下,顺便就 输入 mount c: /usr/cc,看看能够访问 C,也就算了。
今天找到 MAGIC C++的序列号,于是就体验了一把 CYGWIN和MINGW编程,两个都可以,参考资料:如何使用Magic C++ 3.0 与Cygwin 或Mingw 协同工作 http://61.186.70.240:8080/topic.jsp?forumID=7&topic=1114 。但是问题是 直接运行可以,但是DEBUG模式就不行,总是报告 OPEN M:\\cygwin\\usr\\cc\\test22\\test22.cpp open failed,不得其解,怀疑是我昨天 MOUNT的问题,于是进入CYGWIN想UMOUNT,但是总是报告:/usr/cc not mounted ,Invaild argument (error 22)。/CC也试验了,仍然不行,看看UMOUNT得帮助,于是输入 UMOUNT -S,这下完蛋了,所有东西都用不了了。
上网找了一些资料,试验MOUNT -S -B 一个一个MOUNT进来:$ mount -s -b m:/cygwin/lib /lib
$ mount -s -b m:/cygwin/usr /usr $ mount -s -b m:/cygwin/etc /etc $ mount -s -b m:/cygwin/home /home $ mount -s -b m:/cygwin/tmp /tmp $ mount -s -b m:/cygwin/var /var
但是总是报告:bash.exe: warning: could not find /tmp, please create! bash-2.05b$
终于还是重新安装了:根据 http://www.huihoo.org/mirrors/skyeye/skyeyesetup.html SkyEye详细安装使用指南 Ver 0.4 选择了:必须安装的子目录(sub category): (把子目录旁边的”default”用鼠标点一下,直到变成”install”)
Archive Base Devel:包括gcc、make等编译工具 Libs Net Shells Utils: 包括bzip2等实用工具
比我上次1.3G小,904 MB (948,768,527 字节) 大小;占用1.11 GB (1,197,375,488 字节) 包含44934文件,2312个文件夹。
最后输入MOUNT看看它的MOUNT:
m:\\cygwin\\home on /home type system (binmode)
m:\\cygwin\\bin on /bin type system (binmode)
m:\\cygwin\\bin on /usr/bin type system (binmode)
m:\\cygwin\\etc on /etc type system (binmode)
m:\\cygwin\\lib on /lib type system (binmode)
m:\\cygwin\\lib on /usr/lib type system (binmode)
m:\\cygwin\\tmp on /tmp type system (binmode)
m:\\cygwin\\usr on /usr type system (binmode)
m:\\cygwin\\var on /var type system (binmode)
m:\\cygwin on / type system (binmode)
可是http://kde-cygwin.sourceforge.net/kde3/faq.php $ cd c:/cygwin/bin (or wathever your cygwin root dir is) $ umount -s / $ mount -s -b c:/cygwin / 它这个方法我也试验了,不行,他难道可以吗?
标签:cygwin, win, 安装