作者ric2k1 (Ric)
看板EE_DSnP
標題Re: [問題] 不能將函式 static bool ModNum::setVa …
時間Sun Apr 12 00:13:13 2009
: : 2.
: : 請問一下我要寫 testMC 檔只要切換到在 test 資料夾底下打 make test 就好了嗎?
: yes, or "make ./test"
: : 還是要撰寫 makefile...?
test.cpp 寫在 src/test 底下 (已寫好, 不用動),
但是 make 請在 root directory 底下.
: : 3.
: : 要怎麼引用 myString.cpp 裡面的函數呀?
: : 以前只聽過有人include .h 檔案
: : 沒有寫過 include .cpp 檔
: : 我看見了 util.h 檔裡面有加上 extern ...(myString 裡面的函數)
: : 聽說這樣的寫法表示告訴電腦某函數寫在別的檔案裡
: : 但是如果除此之外並沒有人講說那些函數在哪個檔案裡
: : 還能夠找的到嗎?
: You only need to include .h files.
: Those linking problems are done by Makefile, so the computer knows the
: implementation of classes.
對於 cmd package 底下的 .cpp 檔來說, 因為它們都有 include "util.h", 所以你就
直接用就好了. 其他 .cpp 如果有要使用這些 functions, 如果沒有 include 就
include 一下吧!
: : 4.
: : 這次的作業檔案散落各地分佈在很多個資料夾裡
: : 實際上要怎麼把他們合體變成一個執行檔呢?
: Our considerate professor ric has written the Makefile for us, so just
: "make" and the executable will be generated.
: Hope my answers are right, if there's any error, please point out. Thx
Yes, just type "make" and the executable (modCalc) will be made. Of course,
you need to take care of the "TODO's" first.
Type "make test" will create the "testMC" executable.
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 61.224.46.66