G ++ requires include include .h files when compiling C ++ programs, or needs .cpp file

xiaoxiao2021-03-06  68

G requires include include .h files when compiling C programs, or needs .cpp file

Recently, CDT under Eclipse is learned to learn C

It is possible to include .h files only when it is most of it.

The CPP file can be specified with G main.cpp * .cpp * .cpp when compiled.

However, this morning compiled a class template of the class template in this morning Stack.h and stack.cpp, main.h, if only stack.h

Will appear: undefined reference to xxxxxx

The mistake is very strange.

Solving the above mistakes only need to replace Stack.h to stack.cpp.

Why is this?

Fortunately

This article solves the above problems.

Chinaunix.net - C / C compiler and debugger and static library, dynamic library usage summary

Http://dummy.linux.net.cn/~xgwu/cmuo/basics/cbsource3.html

http://www.linuxsir.com/bbs/showthread.php?s=&threadid=1005

Come back Makefile and then look at it.

Some common methods in VC (20)

转载请注明原文地址:https://www.9cbs.com/read-90428.html

New Post(0)