易截截图软件、单文件、免安装、纯绿色、仅160KB

搭建eclipse下的c和c++开发环境


 
我们需要一个cdt,这个可以在Eclipse官网下载。
我们需要MinGW——C/C++编译平台,下载后需要安装,同时选中g++、MinGW Make,同时设置环境变量,将%MinGW_HOME%\bin设置到PATH中,然后我们可以通过命令行敲击gcc,看是否有效果。
我们需要gdb——C/C++调试平台,下载后安装,默认到MinGW_HOME就行。
我们开启eclipse编译一个C/C++工程,右键可以运行,调试。
一直都想在Eclipse下搭建一个C/C++的开发平台,却一直未能如愿。最近,终于成功了,其实很简单。
安装
设置环境变量
 
新建C项目
 
新建C++项目
来段HelloWorld
C的 
C代码
#include ﹤stdio.h>
#include ﹤stdlib.h>
int main(void) {
puts("!!!Hello World!!!"); /* prints !!!Hello World!!! */
return EXIT_SUCCESS;
}
控制台编译输出 
Console代码
**** Build of configuration Debug for project c ****
**** Internal Builder is used for build ****
gcc -O0 -g3 -Wall -c -fmessage-length=0 -osrc\c.o ..\src\c.c
gcc -oc.exe src\c.o
Build complete for project c
Time consumed: 14011 ms.
控制台结果输出 
Console代码
!!!Hello World!!!
C++的 
C++代码
#include ﹤iostream>
using namespace std;
int main() {
cout ﹤﹤ "!!!Hello World!!!" ﹤﹤ endl; // prints !!!Hello World!!!
return 0;
}
控制台编译输出 
Console代码
**** Build of configuration Debug for project cpp ****
**** Internal Builder is used for build ****
g++ -O0 -g3 -Wall -c -fmessage-length=0 -osrc\cpp.o ..\src\cpp.cpp
g++ -ocpp.exe src\cpp.o
Build complete for project cpp
Time consumed: 25452 ms.
控制台结果输出
Console代码
!!!Hello World!!!


相关文档:

转载:Hadoop 应该用C++实现,而不是Java

http://www.trendcaller.com/2009/05/hadoop-should-target-cllvm-not-java.html
Sunday, May 10, 2009
Hadoop should target C++/LLVM, not Java (because of watts)
< type="text/javascript">
digg_url="http://www.trendcaller.com/2009/05/hadoop-should-target-cllvm-not-java.html";
Over the years, ......

entry point to c/c++ or Fortran MEX file

http://www.mathworks.com/access/helpdesk/help/techdoc/apiref/mexfunction.html
mexFunction (C and Fortran) -
Entry point to C/C++ or Fortran MEX-file
C Syntax
#include "mex.h"
void mexFunction(int nlhs, mxArray *plhs[], int nrhs,
const mxArray *prhs[]);
Fortran
Syntax
subrouti ......

Java与C通信要注意的几个问题

1.大尾(big_endian)小尾(little_endian)的问题
基于Web的测试软件是由C++数据采集服务器程序和客户端Java显示程序两部分构成,前者用C++,后者Java语言,存在数据移植问题。因为
在计算机系统中,当包含数字的二进制文件从一个结构移到另一结构时,就出现大尾小尾问题。不同CPU在多字节数(如四字节int)存储时有两种方法 ......

C/C++文件操作[转载]

掌握文本文件读写的方法
了解二进制文件的读写方法
C++文件流:
fstream  // 文件流
ifstream  // 输入文件流
ofstream  // 输出文件流
//创建一个文本文件并写入信息
//同向屏幕上输出信息一样将信息输出至文件
#include<iomanip.h>
#include<fstream.h>
void main()
{
  ofstream f1("d:\\ ......

about pack and align for C/C++

http://msdn.microsoft.com/en-us/library/2e70t5y1(VS.80).aspx
#pragma
pack(  n  )
n : Valid values are 1, 2, 4, 8, and 16.the
alignment of a member will be on a boundary that is either a multiple of 
n
 or
a multiple of the size of the member
,
whichever is smaller.
......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号