³£ÓõÄC/C++¹¤³ÌMakefileÄ£°å
תÌû£ºÒ»»ÔµÄÎÄÕÂ
ÔÚLinuxÏÂ×ö¿ª·¢ÄÑÃâÒª½Ó´¥makefile£¬Õû¸öÏîÄ¿µÄ¹¹½¨¶¼ÒÀÀµÓÚËü¡£100¸ödeveloperÓÐ100ÖÖmakefileµÄд·¨£¬ÔÚÒ»¸ö½Ï´óµÄÏîÄ¿ÖУ¬¸÷ÖÖ¸÷ÑùµÄmakefileÎÞÂÛÔÚ¿ª·¢¡¢ºóÆÚά»¤»¹ÊÇÕû¸öϵͳµÄ³ÖÐø¼¯³É¶¼ÊÇÒ»¸ö¸ºµ£¡£
ÓÐÐÒ²ÎÓëÖع¹Ò»¸öÒÅÁôϵͳµÄmakefile£¬ÒÔÏÂÊÇһЩÐĵúÍÒ»¸ömakefileÄ£°å¡£
Öع¹Ä¿µÄ£º
1.ÇåÎúÒ׶®¡¢ÈÝÒ×ά»¤
2.·½±ãϵͳµÄ³ÖÐø¼¯³É
Öع¹ÔÔò£º
1.×ÓÄ£¿émakefileÄ£°å»¯
2.ÍⲿÒÀÀµ¡¢Í¨Óú궨Ò弯Öл¯
3.ÖмäºÍ×îÖÕÊä³ö¼¯ÖУ¬±ãÓÚϵͳ¹¹½¨
ÏÂÃæÊÇ×ܽá³öµÄÒ»¸ömakefileÄ£°å£¬ÎÒÔÚÈÕ³£µÄ¿ª·¢Öж¼ÓÃËü£¬ÆäÖмÓÈëÁËÏêϸµÄ×¢ÊÍ¡£
view plaincopy to clipboardprint?
#Get the ROOT_PATH which common files located, assuming this makefile located in $(ROOT_PATH)/src/sub_module
ROOT_PATH = $(shell cd ../..; pwd)
#Where define the path of third party modules
include $(ROOT_PATH)/path
#Where define common macros such as CC=gcc, CXX=g++ and so on
include $(ROOT_PATH)/common
#Set target output path and the path of intermidiate object
#The path macros should include in $(ROOT_PATH)/path
OUT_PATH = $(OUTPUT_PATH)/submodule
OBJ_PATH = $(TMPOBJ_PATH)/submodule
TARGET = $(OUT_PATH)/targe
#If the targe is share object then set corresponding flags
#which should define in $(ROOT_PATH)/common
CFLAGS += $(CFLAGS_SO)
LDFLAGS += $(LDFLAGS_SO)
#Custom Predefines
CFLAGS += -DXXXXXXXX
CFLAGS += -DYYYYYYYY
#Dependent header files
#The path macros should include in $(ROOT_PATH)/path
CFLAGS += -I. \
-I$(XXXX_INC) \
-I$(YYYY_INC) \
-I$(ZZZZ_INC)
#Dependent libraries
#The path macros should include in $(ROOT_PATH)/path
LDFLAGS += -L$(XXXX_LIB) -lxxxx \
-L$(YYYY_LIB) -lyyyy
#Set CPP source directory
CPP_SRCDIR = .
#Or set specific CPP Source files
ADDITIONAL_CPP_SOURCES = \
$(PATH_A)/a.cpp \
$(PATH_B)/b.cpp
#Traverse every directory in $(CPP_SRCDIR), and find every cpp file
CPP_SOURCES = $(foreach d,$(CPP_SRCDIR),$(wildcard $(d)/*.cpp) ) $(ADDITIONAL_CPP_SOURCES)
#Traverse every cpp file in $(CPP_SOURCES) and get corresponding object file(.
Ïà¹ØÎĵµ£º
×Ô´Ó½Ó´¥ÕâÃÅÓïÑÔµ½ÏÖÔÚÓÐÒ»¸ö¶àÐÇÆÚµÄʱ¼äÁË£¬ËäÈ»ÒÔºóµÄ·»¹ºÜ³¤£¬»áÓöµ½¸÷ÖÖÀ§ÄÑ£¬µ«Ö»ÒªÓÐÄÍÐĺÍÒãÁ¦£¬»¹Òª½Å̤ʵµØµÄ´òºÃ»ù´¡£¬¾ÍÒ»¶¨ÄÜÓг¤Í¾µÄ½ø²½£¬ºÇºÇ£¬Ï£ÍûÔÚÕâÀïµÄÿһ¸öÈ˶¼ºÍÎÒÒ»Æð¼ÓÓÍ£¬²»¶Ï½ø²½¡£
Ëæ»úº¯Êý¶ÔÿÖÖ±à³ÌÓïÑÔÀ´Ëµ¶¼ÊÇÒ»¸ö²»¿ÉȱÉٵĻ·½Ú£¬ÄÇôÔÚC++ÖÐËüÊÇÈçºÎÓ¦Óõģ¬ÕâÀïΪÁË·½±ãÀí½â£¬¶ÔÒÔÇ ......
VB
If MSComm1.PortOpen = True Then MSComm1.PortOpen = False
MSComm1.CommPort = i1
MSComm1.PortOpen = True
MSComm1.InputMode = comInputModeBinary
MSComm1.InBufferCount = 0
& ......
Delphi Óë C/C++ Êý¾ÝÀàÐͶÔÕÕ±í
DelphiÊý¾ÝÀàÐÍC/C++
ShorInt
8λÓзûºÅÕûÊý
char
Byte
8λÎÞ·ûºÅÕûÊý
BYTE,unsigned short
SmallInt
16λÓзûºÅÕûÊý
short
Word
16λÎÞ·ûºÅÕûÊý
unsigned short
Integer,LongInt
32λÓзûºÅÕûÊý
int,long
Cardinal,LongWord/DWORD
32λÎÞ·ûºÅÕûÊý
unsigned long
Int6 ......
1.½éÉÜÒ»ÏÂSTL£¬Ïêϸ˵Ã÷STLÈçºÎʵÏÖvector¡£
Answer:
STL (±ê׼ģ°æ¿â£¬Standard Template Library)ËüÓÉÈÝÆ÷Ëã·¨µü´úÆ÷×é³É¡£
STLÓÐÒÔϵÄһЩÓŵ㣺
¿ÉÒÔ·½±ãÈÝÒ×µØʵÏÖËÑË÷Êý¾Ý»ò¶ÔÊý¾ÝÅÅÐòµÈһϵÁеÄËã·¨£»
&nb ......