วันพฤหัสบดีที่ 16 กรกฎาคม พ.ศ. 2552

[ eclipse c cpp ] มาเขียน cpp ด้วย eclipse กันเถอะ how to build, compile, add external library path, set environment variable

You can get "Eclipse IDE for C/C++ Developers" from Eclipse download

Create New File

New > Source File

Build

You have to build before run, otherwise you will got error. "Launch failed. Binary not found".

build (Ctrl+B)

add external library (-l)

set environment variable


eclipse tips

  • 'open declaration (F3)' in eclipse is 'go to definition' in virtual studio

  • eclipse comment multiple line highlight the line and "ctrl + /" uncomment use the same shortkey "ctrl + /"

c++ HelloWorld program
#include <stdio.h>

int main(){
printf("Hello");
}

Trick : exclude from build

If you have multiple main() file you may wanna exclude some file from build, otherwise you will got an error "multiple definition of main".

right click at the file that you wanna exclude > Properties


related topic : create c++ shared library in eclipse
see other eclipse topic

ไม่มีความคิดเห็น:

LinkWithin

Related Posts Plugin for WordPress, Blogger...