File tree Expand file tree Collapse file tree 6 files changed +66
-0
lines changed Expand file tree Collapse file tree 6 files changed +66
-0
lines changed Original file line number Diff line number Diff line change @@ -10,4 +10,26 @@ add_executable(server
1010target_link_libraries (server
1111 PRIVATE
1212 absl::status
13+ lib_a
14+ lib_b
15+ )
16+
17+ add_library (lib_a
18+ lib_a.h
19+ lib_a.cc
20+ )
21+
22+ target_link_libraries (lib_a
23+ PRIVATE
24+ lib_b
25+ )
26+
27+ add_library (lib_b
28+ lib_b.h
29+ lib_b.cc
30+ )
31+
32+ target_link_libraries (lib_b
33+ PRIVATE
34+ lib_a
1335)
Original file line number Diff line number Diff line change 1+
2+ #pragma once
3+
4+ #include < iostream>
5+
6+ #include " lib_b.h"
7+
8+ namespace lib_a {
9+ void lib_a_function () {
10+ std::cout << " lib_a_function called" << std::endl;
11+ lib_b::lib_b_self ();
12+ }
13+
14+ void lib_a_self () {
15+ std::cout << " lib_a_self called" << std::endl;
16+ }
17+ }
Original file line number Diff line number Diff line change 1+ #include < iostream>
2+
3+ namespace lib_a {
4+ void lib_a_function () {
5+ // This function is intentionally left empty.
6+ std::cout << " lib_a_function called" << std::endl;
7+ }
8+ }
Original file line number Diff line number Diff line change 1+ #pragma once
2+
3+ #include < iostream>
4+
5+ #include " lib_a.h"
6+
7+ namespace lib_b {
8+ void lib_b_function () {
9+ std::cout << " lib_b_function called" << std::endl;
10+ lib_a::lib_a_self ();
11+ }
12+
13+ void lib_b_self () {
14+ std::cout << " lib_b_self called" << std::endl;
15+ }
16+ }
Original file line number Diff line number Diff line change 11#include " absl/status/status.h"
22#include < iostream>
33
4+ #include " lib_a.h"
5+ #include " lib_b.h"
6+
47int main () {
58 absl::Status status = absl::InternalError (" Something went wrong!" );
69 if (!status.ok ()) std::cerr << " Error: " << status.message () << std::endl;
You can’t perform that action at this time.
0 commit comments