forked from chihyang/CPP_Primer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfactMain.cc
More file actions
28 lines (26 loc) · 887 Bytes
/
Copy pathfactMain.cc
File metadata and controls
28 lines (26 loc) · 887 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Exer06_09, factMain.cc
#include <iostream>
#include "Chapter6.h"
using std::cout;
using std::endl;
int main()
{
int j = fact(12);
cout << j << endl;
return 0;
}
// ******compile command of cl******
// ## compile and link and get an executable file in one step:
// $ >cl -EHsc fact.cc factMain.cc -Fo./obj/ -Fe./obj/factMain.exe
//
// ## compile separately and then link:
// $ >cl -EHsc fact.cc factMain.cc -c -Fo./obj/ #-c means no link
// $ >cl -EHsc ./obj/fact.obj ./obj/factMain.obj -Fe./obj/ #link
// ******compile command of g++******
// ## compile and link and get an executable file in one step:
// $ >g++ fact.cc factMain.cc -o ./obj/factMain.exe
//
// ## compile separately and then link:
// $ >g++ -c fact.cc factMain.cc -o ./obj/fact.obj
// $ >g++ -c factMain.cc factMain.cc -o ./obj/factMain.obj
// $ >g++ ./obj/fact.o ./obj/factMain.o -o ./obj/factMain.exe