From f5b3d018c4341b9e444867693c21a94c662b7183 Mon Sep 17 00:00:00 2001 From: Minjie Date: Wed, 15 Jan 2020 23:16:53 +0800 Subject: [PATCH] make example compile --- CMakeLists.txt | 2 +- example/{example.cpp => main.cpp} | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) rename example/{example.cpp => main.cpp} (97%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 34c48fe..93264c7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,7 @@ include_directories ( set(HEADERS include/SafeQueue.h include/ThreadPool.h) -set(SOURCES src/main.cpp) +set(SOURCES example/main.cpp) SET(CMAKE_CXX_FLAGS -pthread) diff --git a/example/example.cpp b/example/main.cpp similarity index 97% rename from example/example.cpp rename to example/main.cpp index ea90694..469d068 100644 --- a/example/example.cpp +++ b/example/main.cpp @@ -36,7 +36,8 @@ int multiply_return(const int a, const int b) { } -void example() { +int main(int argc, char *argv[]) +{ // Create pool with 3 threads ThreadPool pool(3); @@ -66,4 +67,6 @@ void example() { std::cout << "Last operation result is equals to " << res << std::endl; pool.shutdown(); + + return 0; }