Development of eclipse CDT

Source: Internet
Author: User

C/C ++ Compiler
Gcc
Pre-processing, compiling, assembly, and linking)

Common commands:
G ++-compile C ++
Gcc-compile C

-I. Find the header file.
E. g ++ Foo. C-I/home/xiaowp/include-O foo

-L find the library file
E. g ++ Foo. C-L/home/xiaowp/lib-lfoo-O foo

Reference
Http://www.linuxdby.com/articlesdisplay.php? Newsid= 234
Http://www.linuxdby.com/articlesdisplay.php? Newsid= 235
Http://tech.ccidnet.com/pub/article/c309_a102603_p1.html

GDB
Make

Mingw-- Implementation of GCC in window

Depvelopement Tool
Eclipse CDT

Create a managed make C ++ Project
Generate makefile automatically. in C/C ++ build, Tool Setting can select to modify many G ++ parameters.

Generate so
G ++ test. cpp-FPIC-shared-O libtest. So
If it is better to generate a token as dllin windows, the ld.exe cannot find ltest error will be reported when the link is closed. Stupid.

Reference
Http://bbs.chinaunix.net/forum/viewtopic.php? T = 373418

Reference so
Specify
C:/Java/Eclipse/workspace/testmanage> G ++ testm. cpp-I c:/Java/Eclipse/workspace/
Testso-l c:/Java/Eclipse/workspace/testso-llibtest. So-O testm

Specify
In C/C ++ build, Tool Setting sets the header file of gcc C ++ compiler-> directories and the library file of gcc C ++ linker --> libaries respectively.

You also need to set the path
Window: set the path and add the So path. Otherwise, the LD cannot be found.
Linux: LD_LIBRARY_PATH

Window: When the EXE file is successfully generated, copy so to the current directory of the exe. Execution successful

Reference
Http://sourceforge.net/mailarchive/forum.php? Forum_id = 5119 & max_rows = 25 & Style = nested & viewmonth = 200406

Use C functions in C ++
E. g extern int Hello ();

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.