当前位置: 首页 > news >正文

旅游景区网站开发的政策可行性全网搜索软件

旅游景区网站开发的政策可行性,全网搜索软件,提升网站排名,中国近期的军事大新闻CMake 实战构建TcpServer项目 静态库/动态库-CSDN博客https://blog.csdn.net/weixin_41987016/article/details/135608829?spm1001.2014.3001.5501 在这篇博客的基础上,我们把头文件放在include里边,把源文件放在src里边,重新构建 hehedali…

CMake 实战构建TcpServer项目 静态库/动态库-CSDN博客icon-default.png?t=N7T8https://blog.csdn.net/weixin_41987016/article/details/135608829?spm=1001.2014.3001.5501 在这篇博客的基础上,我们把头文件放在include里边,把源文件放在src里边,重新构建

heheda@linux:~/Linux/LinuxServerCppInclude$ tree
.
├── CMakeLists.txt
├── common
│   ├── CMakeLists.txt
│   ├── include
│   │   ├── Buffer.h
│   │   ├── Channel.h
│   │   └── Log.h
│   └── src
│       ├── Buffer.cpp
│       └── Channel.cpp
├── http
│   ├── CMakeLists.txt
│   ├── include
│   │   ├── HttpRequest.h
│   │   └── HttpResponse.h
│   └── src
│       ├── HttpRequest.cpp
│       └── HttpResponse.cpp
├── main.cpp
├── reactor
│   ├── CMakeLists.txt
│   ├── include
│   │   ├── Dispatcher.h
│   │   ├── EpollDispatcher.h
│   │   ├── EventLoop.h
│   │   ├── PollDispatcher.h
│   │   └── SelectDispatcher.h
│   └── src
│       ├── Dispatcher.cpp
│       ├── EpollDispatcher.cpp
│       ├── EventLoop.cpp
│       ├── PollDispatcher.cpp
│       └── SelectDispatcher.cpp
├── tcp
│   ├── CMakeLists.txt
│   ├── include
│   │   ├── TcpConnection.h
│   │   └── TcpServer.h
│   └── src
│       ├── TcpConnection.cpp
│       └── TcpServer.cpp
└── thread├── CMakeLists.txt├── include│   ├── ThreadPool.h│   └── WorkerThread.h└── src├── ThreadPool.cpp└── WorkerThread.cpp15 directories, 34 files
heheda@linux:~/Linux/LinuxServerCppInclude$

一、静态库 

1.在common文件夹中的CMakeLists.txt

cmake_minimum_required(VERSION 3.10)
project(common)# 搜索源文件
aux_source_directory(./src/ SRC)
set(LIBRARY_OUTPUT_PATH ${LIBPATH}) # 库生成的路径 LIBPATHadd_library(common STATIC ${SRC}) # 静态库

2.在http文件夹中的CMakeLists.txt

cmake_minimum_required(VERSION 3.10)
project(http)# 搜索源文件
aux_source_directory(./src/ SRC)
set(LIBRARY_OUTPUT_PATH ${LIBPATH}) # 库生成的路径 LIBPATHadd_library(http STATIC ${SRC}) # 静态库

3.在reactor文件夹中的CMakeLists.txt

cmake_minimum_required(VERSION 3.10)
project(reactor)
aux_source_directory(./src/ SRC)# 搜索源文件
set(LIBRARY_OUTPUT_PATH ${LIBPATH}) # 库生成的路径 LIBPATHadd_library(reactor STATIC ${SRC}) # 静态库

4.在tcp文件夹中的CMakeLists.txt

cmake_minimum_required(VERSION 3.10)
project(tcp)link_libraries(common http reactor)
aux_source_directory(./src/ SRC)# 搜索源文件
set(LIBRARY_OUTPUT_PATH ${LIBPATH}) # 库生成的路径 LIBPATHadd_library(tcp STATIC ${SRC}) # 静态库

5.在thread文件夹中的CMakeLists.txt

cmake_minimum_required(VERSION 3.10)
project(thread)
aux_source_directory(./src/ SRC)# 搜索源文件
set(LIBRARY_OUTPUT_PATH ${LIBPATH}) # 库生成的路径 LIBPATHadd_library(thread STATIC ${SRC}) # 静态库

 6.在根目录中的CMakeLists.txt

cmake_minimum_required(VERSION 3.10)
project(HttpWeb)# 库生成的路径
set(LIBPATH ${PROJECT_SOURCE_DIR}/staticLib)include_directories(${PROJECT_SOURCE_DIR}/common/include)
include_directories(${PROJECT_SOURCE_DIR}/http/include)
include_directories(${PROJECT_SOURCE_DIR}/reactor/include)
include_directories(${PROJECT_SOURCE_DIR}/tcp/include)
include_directories(${PROJECT_SOURCE_DIR}/thread/include)# 给当前节点添加子目录
add_subdirectory(common)
add_subdirectory(http)
add_subdirectory(reactor)
add_subdirectory(tcp)
add_subdirectory(thread)link_libraries(common http reactor tcp thread -lpthread)
add_executable(server main.cpp)# 指定输出的路径
set(HOME ${PROJECT_SOURCE_DIR}) # 定义一个变量用于存储一个绝对路径
set(EXECUTABLE_OUTPUT_PATH ${HOME}/bin) # 将拼接好的路径值设置给 EXECUTABLE_OUTPUT_PATH 变量
  •  执行命令和结果:
heheda@linux:~/Linux/LinuxServerCppInclude$ mkdir build
heheda@linux:~/Linux/LinuxServerCppInclude$ cd build/
heheda@linux:~/Linux/LinuxServerCppInclude/build$ cmake ..
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/heheda/Linux/LinuxServerCppInclude/build
heheda@linux:~/Linux/LinuxServerCppInclude/build$ make
Scanning dependencies of target thread
[  5%] Building CXX object thread/CMakeFiles/thread.dir/src/ThreadPool.cpp.o
[ 10%] Building CXX object thread/CMakeFiles/thread.dir/src/WorkerThread.cpp.o
[ 15%] Linking CXX static library ../../staticLib/thread/libthread.a
[ 15%] Built target thread
Scanning dependencies of target common
[ 20%] Building CXX object common/CMakeFiles/common.dir/src/Buffer.cpp.o
[ 25%] Building CXX object common/CMakeFiles/common.dir/src/Channel.cpp.o
[ 30%] Linking CXX static library ../../staticLib/common/libcommon.a
[ 30%] Built target common
Scanning dependencies of target http
[ 35%] Building CXX object http/CMakeFiles/http.dir/src/HttpRequest.cpp.o
[ 40%] Building CXX object http/CMakeFiles/http.dir/src/HttpResponse.cpp.o
[ 45%] Linking CXX static library ../../staticLib/http/libhttp.a
[ 45%] Built target http
Scanning dependencies of target reactor
[ 50%] Building CXX object reactor/CMakeFiles/reactor.dir/src/Dispatcher.cpp.o
[ 55%] Building CXX object reactor/CMakeFiles/reactor.dir/src/EpollDispatcher.cpp.o
[ 60%] Building CXX object reactor/CMakeFiles/reactor.dir/src/EventLoop.cpp.o
[ 65%] Building CXX object reactor/CMakeFiles/reactor.dir/src/PollDispatcher.cpp.o
[ 70%] Building CXX object reactor/CMakeFiles/reactor.dir/src/SelectDispatcher.cpp.o
[ 75%] Linking CXX static library ../../staticLib/reactor/libreactor.a
[ 75%] Built target reactor
Scanning dependencies of target tcp
[ 80%] Building CXX object tcp/CMakeFiles/tcp.dir/src/TcpConnection.cpp.o
[ 85%] Building CXX object tcp/CMakeFiles/tcp.dir/src/TcpServer.cpp.o
[ 90%] Linking CXX static library ../../staticLib/tcp/libtcp.a
[ 90%] Built target tcp
Scanning dependencies of target server
[ 95%] Building CXX object CMakeFiles/server.dir/main.cpp.o
[100%] Linking CXX executable ../bin/server
[100%] Built target server
heheda@linux:~/Linux/LinuxServerCppInclude/build$ cd ../bin
heheda@linux:~/Linux/LinuxServerCppInclude/bin$ ./server
DEBUG: /home/heheda/Linux/LinuxServerCppInclude/tcp/src/TcpServer.cpp@run, line: 66
***LogInfo[服务器程序已经启动了...]

二、动态库

1.在common文件夹中的CMakeLists.txt

cmake_minimum_required(VERSION 3.10)
project(common)# 搜索源文件
aux_source_directory(./src/ SRC)
set(LIBRARY_OUTPUT_PATH ${LIBPATH}) # 库生成的路径 LIBPATHadd_library(common SHARED ${SRC}) # 动态库

2.在http文件夹中的CMakeLists.txt

cmake_minimum_required(VERSION 3.10)
project(http)# 搜索源文件
aux_source_directory(./src/ SRC)
set(LIBRARY_OUTPUT_PATH ${LIBPATH}) # 库生成的路径 LIBPATHadd_library(http SHARED ${SRC}) # 动态库

3.在reactor文件夹中的CMakeLists.txt

cmake_minimum_required(VERSION 3.10)
project(reactor)
aux_source_directory(./src/ SRC)# 搜索源文件
set(LIBRARY_OUTPUT_PATH ${LIBPATH}) # 库生成的路径 LIBPATHadd_library(reactor SHARED ${SRC}) # 动态库

4.在tcp文件夹中的CMakeLists.txt

cmake_minimum_required(VERSION 3.10)
project(tcp)link_libraries(common http reactor)
aux_source_directory(./src/ SRC)# 搜索源文件
set(LIBRARY_OUTPUT_PATH ${LIBPATH}) # 库生成的路径 LIBPATHadd_library(tcp SHARED ${SRC}) # 动态库

5.在thread文件夹中的CMakeLists.txt

cmake_minimum_required(VERSION 3.10)
project(thread)
aux_source_directory(./src/ SRC)# 搜索源文件
set(LIBRARY_OUTPUT_PATH ${LIBPATH}) # 库生成的路径 LIBPATHadd_library(thread SHARED ${SRC}) # 动态库

6.在根目录中的CMakeLists.txt

cmake_minimum_required(VERSION 3.10)
project(HttpWeb)# 库生成的路径
set(LIBPATH ${PROJECT_SOURCE_DIR}/sharedLib)include_directories(${PROJECT_SOURCE_DIR}/common/include)
include_directories(${PROJECT_SOURCE_DIR}/http/include)
include_directories(${PROJECT_SOURCE_DIR}/reactor/include)
include_directories(${PROJECT_SOURCE_DIR}/tcp/include)
include_directories(${PROJECT_SOURCE_DIR}/thread/include)# 给当前节点添加子目录
add_subdirectory(common)
add_subdirectory(http)
add_subdirectory(reactor)
add_subdirectory(tcp)
add_subdirectory(thread)# link_libraries(common http reactor tcp thread -lpthread)
add_executable(server main.cpp)
target_link_libraries(server common http reactor tcp thread -lpthread)# 指定输出的路径
set(HOME ${PROJECT_SOURCE_DIR}) # 定义一个变量用于存储一个绝对路径
set(EXECUTABLE_OUTPUT_PATH ${HOME}/bin) # 将拼接好的路径值设置给 EXECUTABLE_OUTPUT_PATH 变量


文章转载自:
http://dinncoballyrag.tqpr.cn
http://dinncogalen.tqpr.cn
http://dinncoprimula.tqpr.cn
http://dinncopineland.tqpr.cn
http://dinncoicc.tqpr.cn
http://dinncomoneymaking.tqpr.cn
http://dinncotranscurrent.tqpr.cn
http://dinncopodzolisation.tqpr.cn
http://dinncoprotuberant.tqpr.cn
http://dinncomarlpit.tqpr.cn
http://dinncoreforming.tqpr.cn
http://dinncoworking.tqpr.cn
http://dinncounspilt.tqpr.cn
http://dinncolosable.tqpr.cn
http://dinncolagos.tqpr.cn
http://dinncorusa.tqpr.cn
http://dinncoantler.tqpr.cn
http://dinncoalmond.tqpr.cn
http://dinncounrifled.tqpr.cn
http://dinncotinglass.tqpr.cn
http://dinnconepenthes.tqpr.cn
http://dinncohomochromatism.tqpr.cn
http://dinncomonorhinous.tqpr.cn
http://dinncoswiz.tqpr.cn
http://dinncoincompliance.tqpr.cn
http://dinncodisennoble.tqpr.cn
http://dinncowifehood.tqpr.cn
http://dinncoseptilateral.tqpr.cn
http://dinncotunica.tqpr.cn
http://dinncotactful.tqpr.cn
http://dinncoplastics.tqpr.cn
http://dinncodogmatician.tqpr.cn
http://dinncojitney.tqpr.cn
http://dinncowatchfulness.tqpr.cn
http://dinncogoddam.tqpr.cn
http://dinncoincipit.tqpr.cn
http://dinncoudometric.tqpr.cn
http://dinncobistable.tqpr.cn
http://dinncothalamencephalon.tqpr.cn
http://dinncotrig.tqpr.cn
http://dinncopycnosis.tqpr.cn
http://dinncoanalyzing.tqpr.cn
http://dinncozoan.tqpr.cn
http://dinncopectinated.tqpr.cn
http://dinncoyellowthroat.tqpr.cn
http://dinncoadina.tqpr.cn
http://dinncoaerophagia.tqpr.cn
http://dinncotableful.tqpr.cn
http://dinncocontinuator.tqpr.cn
http://dinncocolltype.tqpr.cn
http://dinncohyetometer.tqpr.cn
http://dinncoalfine.tqpr.cn
http://dinncoabnegation.tqpr.cn
http://dinncobreakbone.tqpr.cn
http://dinncounformulated.tqpr.cn
http://dinncothetatron.tqpr.cn
http://dinncovhs.tqpr.cn
http://dinncoheterozygosity.tqpr.cn
http://dinncochronicles.tqpr.cn
http://dinncocongested.tqpr.cn
http://dinncoentameba.tqpr.cn
http://dinncocaldoverde.tqpr.cn
http://dinncoregraft.tqpr.cn
http://dinncosheriffalty.tqpr.cn
http://dinncocaecum.tqpr.cn
http://dinncoblower.tqpr.cn
http://dinncoclassbook.tqpr.cn
http://dinncocalculagraph.tqpr.cn
http://dinncobloodstained.tqpr.cn
http://dinncoaraby.tqpr.cn
http://dinncoorcin.tqpr.cn
http://dinncoballetically.tqpr.cn
http://dinncogeezer.tqpr.cn
http://dinncobratwurst.tqpr.cn
http://dinncogompa.tqpr.cn
http://dinncodiaphony.tqpr.cn
http://dinncoapolaustic.tqpr.cn
http://dinncoformless.tqpr.cn
http://dinncoosa.tqpr.cn
http://dinncovase.tqpr.cn
http://dinncooverproduction.tqpr.cn
http://dinncosusceptance.tqpr.cn
http://dinncohermit.tqpr.cn
http://dinncohorunspatio.tqpr.cn
http://dinncocounterfoil.tqpr.cn
http://dinncoinexorably.tqpr.cn
http://dinncochlorofluoromethane.tqpr.cn
http://dinncobutyral.tqpr.cn
http://dinncotetracarpellary.tqpr.cn
http://dinncororschach.tqpr.cn
http://dinncodolmus.tqpr.cn
http://dinncosalutatorian.tqpr.cn
http://dinncointerpretress.tqpr.cn
http://dinnconumber.tqpr.cn
http://dinncounicef.tqpr.cn
http://dinncoforehock.tqpr.cn
http://dinncohadrosaurus.tqpr.cn
http://dinncounendued.tqpr.cn
http://dinncosexennium.tqpr.cn
http://dinncobebung.tqpr.cn
http://www.dinnco.com/news/133174.html

相关文章:

  • 汽车建设网站的能力免费b站推广网站短视频
  • 电商网站规划论文企业推广方法
  • 在域名做网站长沙百度推广排名
  • 做计算机版权需要网站源代码软文推广发布平台
  • 广州专业seo公司seo研究所
  • 微博网站建设aso应用优化
  • 泊头在哪做网站比较好网站seo怎么操作
  • 云南楚雄医药高等专科学校桔子seo
  • 宜丰做网站的人力资源培训机构
  • 网站关键字选择标准百度推广售后电话
  • 阿里网站销量做不起来怎么办宁波专业seo服务
  • 佛山网站建设公司有哪些?广州市口碑seo推广外包
  • 手机网站引导页js插件seo成创网络
  • 给别人生日做网站网站seo是干什么的
  • 网站开发教程收费版公司网络推广排名定制
  • 大学生做的美食网站1688自然排名怎么做好
  • 如何把网站一个栏目做301跳转seo推广方法
  • 张家港网站建设做网站大数据技术主要学什么
  • php论坛网站源码下载引擎网站推广法
  • 苏州市住建局官方网站seo关键字排名
  • wordpress tinymce编辑器企业如何进行搜索引擎优化
  • springmvc做网站百度付费问答平台
  • 淄博好的建网站公司建站系统源码
  • 哪个网站用户体验较好成品网站源码
  • 电商网站建设流程图好看的网站ui
  • sql与网站开发网易最新消息新闻
  • 一起做网店网站哪里进货的绍兴百度推广优化排名
  • wordpress 代码生成郑州seo技术博客
  • 餐饮行业做微信网站有什么好处链接买卖平台
  • 电子商务网站建设项目规划书百度搜索优化平台