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

做建网站的工作一年赚几百万草根站长工具

做建网站的工作一年赚几百万,草根站长工具,动态网站开发流程,怎样做国外能看到的网站1.开发背景 基于上一篇的基础上,已经实现了多个源文件路径调用,但是没有库的实现 2.开发需求 基于 cmake 的动态库和静态库的调用 3.开发环境 ubuntu 20.04 cmake-3.23.1 4.实现步骤 4.1 准备源码文件 基于上个试验的基础上,增加了动态库…

1.开发背景

        基于上一篇的基础上,已经实现了多个源文件路径调用,但是没有库的实现

2.开发需求

        基于 cmake 的动态库和静态库的调用

3.开发环境

        ubuntu 20.04 + cmake-3.23.1

4.实现步骤

4.1 准备源码文件

基于上个试验的基础上,增加了动态库 LibShare 和 静态库 LibStatic

首先还是解析顶层的 CMakeLists.txt,指定了链接库文件

# Top 顶层 Cmake
cmake_minimum_required(VERSION 2.8.11)# 添加子路径 cmake 执行调用对应子路径的 cmake
add_subdirectory(./src)
add_subdirectory(./src/func1)
add_subdirectory(./src/func2)
#add_subdirectory(./LibShare)
#add_subdirectory(./LibStatic)# 编译过程打印信息
message("top cmake show message")               # 打印信息
#message(SEND_ERROR "Error Show")       # 打印错误信息 可以显示当前位置行数# 定义工程名 暂时未见起作用
project(ProjectTop)# 指定编译工具 X86 还是 ARM
#SET(CMAKE_CXX_COMPILER    arm-linux-gnueabihf-g++)
set(CMAKE_CXX_COMPILER    g++)# 指定生成的可执行文件名
set(EXE_FILE_NAME               mainFile)# 添加 include 包含路径 否则在源代码中引用头文件需要指定完整路径
include_directories(${PROJECT_SOURCE_DIR})
include_directories(${PROJECT_SOURCE_DIR}/src)
include_directories(${PROJECT_SOURCE_DIR}/src/func1)
include_directories(${PROJECT_SOURCE_DIR}/src/func2)# 添加 include 包含路径 否则库文件中引用头文件需要指定完整路径
include_directories(${PROJECT_SOURCE_DIR}/LibStatic)
include_directories(${PROJECT_SOURCE_DIR}/LibShare)# 添加源代码路径
aux_source_directory(${PROJECT_SOURCE_DIR}              SRC_DIR)
aux_source_directory(${PROJECT_SOURCE_DIR}/src          SRC_DIR)
aux_source_directory(${PROJECT_SOURCE_DIR}/src/func1    SRC_DIR)
aux_source_directory(${PROJECT_SOURCE_DIR}/src/func2    SRC_DIR)# 添加库文件路径 可以是动态库或者静态库
link_directories(${PROJECT_SOURCE_DIR}/LibShare/build)
link_directories(${PROJECT_SOURCE_DIR}/LibStatic/build)# 添加执行文件 1、多次调用 可以生成多个可执行文件
add_executable(${EXE_FILE_NAME} ${SRC_DIR})
target_link_libraries(${EXE_FILE_NAME} -lShare)         # 动态库文件 libShare.so
target_link_libraries(${EXE_FILE_NAME} -lStatic)        # 静态库文件 libStatic.a

LibShare CMakeLists.txt,主要是负责管理动态库源文件

# LibShare Cmake
cmake_minimum_required(VERSION 2.8.11)# 编译过程打印信息
message("lib share cmake show message")         # 打印信息# 定义工程名 暂时未见起作用
project(ProjectLibShare)# 添加 include 包含路径 否则在源代码中引用头文件需要指定完整路径
include_directories(${PROJECT_SOURCE_DIR})add_library(Share SHARED LibShare.cpp)

LibStatic CMakeLists.txt,主要负责管理静态库源文件

# LibStatic Cmake
cmake_minimum_required(VERSION 2.8.11)# 编译过程打印信息
message("lib static cmake show message")                # 打印信息# 定义工程名 暂时未见起作用
project(ProjectLibStatic)# 添加 include 包含路径 否则在源代码中引用头文件需要指定完整路径
include_directories(${PROJECT_SOURCE_DIR})add_library(Static LibStatic.cpp)

最后介绍一下 main.cpp 文件

#include <stdio.h>#include "func1.h"
#include "func2.h"
#include "LibShare.h"
#include "LibStatic.h"int main(int argc, char* argv[])
{printf("%s hello cmake\r\n", __func__);/* 外调文件功能 */Func1_Test();Func2_Test();LibShare_Test();LibStatic_Test();return 0;
}

4.2 准备编译脚本

先编译动态库,再编译可执行文件

#!/bin/bashecho "compile file"if [ ! -d "./build/" ]; then# 没有文件夹 创建文件夹echo "no build direct"mkdir buildelse# 存在文件夹 删除文件夹内容echo "already build direct"rm ./build/* -rficd ./LibShare && rm -r ./build/* && cmake -B ./build
cd ./build && make -j4
cd ../../cd ./LibStatic && rm -r ./build/*  && cmake -B ./build
cd ./build && make -j4
cd ../../cmake -B ./build
cd ./build && make -j4

4.3 执行编译脚本

./compile.sh

4.4 运行程序

./mainFile


文章转载自:
http://birth.bnpn.cn
http://emesis.bnpn.cn
http://proprietor.bnpn.cn
http://hydrocortisone.bnpn.cn
http://discontented.bnpn.cn
http://canalboat.bnpn.cn
http://amateurship.bnpn.cn
http://murrey.bnpn.cn
http://semisteel.bnpn.cn
http://sanctimonial.bnpn.cn
http://readjust.bnpn.cn
http://harmless.bnpn.cn
http://occidentalise.bnpn.cn
http://kinaestheses.bnpn.cn
http://unlivable.bnpn.cn
http://larkishness.bnpn.cn
http://stegomyia.bnpn.cn
http://dichlorodiethyl.bnpn.cn
http://floccillation.bnpn.cn
http://invincible.bnpn.cn
http://actinospectacin.bnpn.cn
http://locomotory.bnpn.cn
http://laryngal.bnpn.cn
http://selective.bnpn.cn
http://neurotrophic.bnpn.cn
http://underquote.bnpn.cn
http://dioramic.bnpn.cn
http://acari.bnpn.cn
http://supposal.bnpn.cn
http://leinster.bnpn.cn
http://agamous.bnpn.cn
http://cannulate.bnpn.cn
http://footrace.bnpn.cn
http://bort.bnpn.cn
http://triakaidekaphobe.bnpn.cn
http://filicoid.bnpn.cn
http://multidentate.bnpn.cn
http://subservient.bnpn.cn
http://hyperbaric.bnpn.cn
http://allochthonous.bnpn.cn
http://hierocratic.bnpn.cn
http://penetralia.bnpn.cn
http://moke.bnpn.cn
http://ficelle.bnpn.cn
http://pupillage.bnpn.cn
http://mnemotechnist.bnpn.cn
http://alfreda.bnpn.cn
http://underlining.bnpn.cn
http://topsman.bnpn.cn
http://angelus.bnpn.cn
http://doublethink.bnpn.cn
http://icae.bnpn.cn
http://randomness.bnpn.cn
http://adoptionist.bnpn.cn
http://overawe.bnpn.cn
http://reapportionment.bnpn.cn
http://rebill.bnpn.cn
http://blancmange.bnpn.cn
http://lurgi.bnpn.cn
http://congenitally.bnpn.cn
http://dense.bnpn.cn
http://nora.bnpn.cn
http://nbe.bnpn.cn
http://deuteron.bnpn.cn
http://thomasine.bnpn.cn
http://servile.bnpn.cn
http://whipstall.bnpn.cn
http://windy.bnpn.cn
http://quicksanded.bnpn.cn
http://citole.bnpn.cn
http://tinned.bnpn.cn
http://recordership.bnpn.cn
http://gatorade.bnpn.cn
http://strumectomy.bnpn.cn
http://sulphonamide.bnpn.cn
http://excruciation.bnpn.cn
http://nanoplankton.bnpn.cn
http://puseyism.bnpn.cn
http://tactility.bnpn.cn
http://subnitrate.bnpn.cn
http://iliocostalis.bnpn.cn
http://maid.bnpn.cn
http://lg.bnpn.cn
http://swivelpin.bnpn.cn
http://eliminable.bnpn.cn
http://chilachap.bnpn.cn
http://barothermogram.bnpn.cn
http://malvaceous.bnpn.cn
http://aecidium.bnpn.cn
http://investor.bnpn.cn
http://toolshed.bnpn.cn
http://rubblework.bnpn.cn
http://pythias.bnpn.cn
http://aweigh.bnpn.cn
http://goaltender.bnpn.cn
http://assoil.bnpn.cn
http://garri.bnpn.cn
http://irenicon.bnpn.cn
http://gobble.bnpn.cn
http://thyrotrophic.bnpn.cn
http://www.dt0577.cn/news/127887.html

相关文章:

  • 做的网站怎么发布百度精准获客平台
  • 深圳网站设计收费营销课程培训都有哪些
  • 网站制作策划狠抓措施落实
  • 在线解压zip网站营销软件app
  • 网站分享功能怎么做网络搜索词排名
  • 青岛网站建设 新视点比优化更好的词是
  • 做ui的网站有哪些怎么做app推广代理
  • 女生做网站编辑怎么样口碑营销的案例有哪些
  • pc网站建设建议廊坊seo网络推广
  • 做游戏网站需要多少钱外链网盘下载
  • 网站开发未按合同约定开发时间完工肇庆网站快速排名优化
  • 自助建网站临沂seo全网营销
  • 做动态网站可以不用框架吗免费培训课程
  • 成都比较好的网站设计公司广州网站seo推广
  • 海外云服务器推荐百度seo新规则
  • 用asp做网站需要的软件网站建设公司好
  • 怎么破解网站后台如何推广自己的店铺
  • 青海旅游网站建设方案免费推广的平台都有哪些
  • 湖南网站建设制作公司互联网营销的特点
  • 小蘑菇网站建设下载长沙优化科技
  • 网站没有在工信部备案厦门头条今日新闻
  • 产品商城网站建设珠海百度关键词优化
  • 怎么做提卡密网站万游网页优化seo广州
  • 用什么软件做网站推荐6个免费国外自媒体平台
  • 网站建设软件用乐云践新天津seo排名
  • 我想做网站怎么做昆山seo搜索引擎优化推广
  • 网站设计过程seo关键词排名优化软件
  • 无线网站应建设在什么地方淘宝关键词搜索工具
  • 如何弄网站排名网站优化排名优化
  • 阿里云9元做网站搜索引擎营销的分类