Dpuiu C: Difference between revisions

From Cbcb
Jump to navigation Jump to search
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 4: Line 4:
= Compiling =
= Compiling =


* Debug info
* CFLAGS  flags
   CFLAGS = -g
   -g           # debugging
  -O          # optimizing   
  -pg          # profiling


* Optimization (no debug)
Example:
   CFLAGS = -O
   cd /fs/szdevel/dpuiu/SourceForge/AMOS/src/Bank
 
  cp bank-transact.cc bank-transact2.cc
 
  g++ -I../../include/AMOS -o bank-transact2 bank-transact2.cc ../Common/libCommon.a ../AMOS/libAMOS.a
 
  #or
 
  g++ -I../../include/AMOS -c bank-transact2.cc
  g++ bank-transact2.o  ../Common/libCommon.a ../AMOS/libAMOS.a
 
  #full path
  g++ -g -I/fs/szdevel/dpuiu/SourceForge/AMOS/include/AMOS/ -o bank-transact2 bank-transact2.cc /fs/szdevel/dpuiu/SourceForge/AMOS/src/Common/libCommon.a  /fs/szdevel/dpuiu/SourceForge/AMOS/src/AMOS/libAMOS.a

Latest revision as of 22:49, 23 January 2009

Style

Compiling

  • CFLAGS flags
 -g           # debugging
 -O           # optimizing     
 -pg          # profiling

Example:

 cd /fs/szdevel/dpuiu/SourceForge/AMOS/src/Bank
 
 cp bank-transact.cc bank-transact2.cc
 g++ -I../../include/AMOS -o bank-transact2 bank-transact2.cc ../Common/libCommon.a ../AMOS/libAMOS.a
 
 #or
 
 g++ -I../../include/AMOS -c bank-transact2.cc
 g++ bank-transact2.o  ../Common/libCommon.a ../AMOS/libAMOS.a
 #full path
 g++ -g -I/fs/szdevel/dpuiu/SourceForge/AMOS/include/AMOS/ -o bank-transact2 bank-transact2.cc /fs/szdevel/dpuiu/SourceForge/AMOS/src/Common/libCommon.a  /fs/szdevel/dpuiu/SourceForge/AMOS/src/AMOS/libAMOS.a