当前位置: 首页 > 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://dinncomonotonously.bkqw.cn
http://dinncowoodenness.bkqw.cn
http://dinncoalabama.bkqw.cn
http://dinncoversant.bkqw.cn
http://dinncogairish.bkqw.cn
http://dinncoformfitting.bkqw.cn
http://dinncoinstructor.bkqw.cn
http://dinncoplanes.bkqw.cn
http://dinncosudarium.bkqw.cn
http://dinncosememe.bkqw.cn
http://dinncoravenous.bkqw.cn
http://dinncofinely.bkqw.cn
http://dinncounbid.bkqw.cn
http://dinncofisheye.bkqw.cn
http://dinncogalvo.bkqw.cn
http://dinncoteleferique.bkqw.cn
http://dinncodesmid.bkqw.cn
http://dinncokickup.bkqw.cn
http://dinncoepizoism.bkqw.cn
http://dinncothoth.bkqw.cn
http://dinncouniparous.bkqw.cn
http://dinncoexcisable.bkqw.cn
http://dinnconecrobacillosis.bkqw.cn
http://dinncotenour.bkqw.cn
http://dinncocrinotoxin.bkqw.cn
http://dinncodisable.bkqw.cn
http://dinncoassemblage.bkqw.cn
http://dinncoeuphemism.bkqw.cn
http://dinncoheteropathy.bkqw.cn
http://dinncomegascopic.bkqw.cn
http://dinncobagful.bkqw.cn
http://dinncogomorrah.bkqw.cn
http://dinncoopinion.bkqw.cn
http://dinncoamphimictic.bkqw.cn
http://dinncowast.bkqw.cn
http://dinncotaffy.bkqw.cn
http://dinncodubbing.bkqw.cn
http://dinncopyrometry.bkqw.cn
http://dinncoliquefacient.bkqw.cn
http://dinncobartizan.bkqw.cn
http://dinncoescrime.bkqw.cn
http://dinncoanlace.bkqw.cn
http://dinncoexertive.bkqw.cn
http://dinncomezzogiorno.bkqw.cn
http://dinncodeionization.bkqw.cn
http://dinncobegan.bkqw.cn
http://dinncocio.bkqw.cn
http://dinncoinvulnerable.bkqw.cn
http://dinncounconfident.bkqw.cn
http://dinncocastigator.bkqw.cn
http://dinncodepartmental.bkqw.cn
http://dinncodiscographer.bkqw.cn
http://dinncomorpheus.bkqw.cn
http://dinncoatt.bkqw.cn
http://dinncocolostrum.bkqw.cn
http://dinncodeproteinize.bkqw.cn
http://dinncodestructively.bkqw.cn
http://dinncomazdaism.bkqw.cn
http://dinncoplp.bkqw.cn
http://dinncokrakau.bkqw.cn
http://dinncocolourless.bkqw.cn
http://dinncoprintseller.bkqw.cn
http://dinncobioinstrumentation.bkqw.cn
http://dinncowrath.bkqw.cn
http://dinncoselfward.bkqw.cn
http://dinncolallan.bkqw.cn
http://dinncoimbark.bkqw.cn
http://dinncoiconoduly.bkqw.cn
http://dinncosuperfix.bkqw.cn
http://dinncofoamflower.bkqw.cn
http://dinncokickdown.bkqw.cn
http://dinncocoercivity.bkqw.cn
http://dinncolawyerly.bkqw.cn
http://dinncorenominate.bkqw.cn
http://dinncoleone.bkqw.cn
http://dinncomedullary.bkqw.cn
http://dinncoaeroview.bkqw.cn
http://dinncopoplin.bkqw.cn
http://dinncodopy.bkqw.cn
http://dinncounassuaged.bkqw.cn
http://dinncobrawniness.bkqw.cn
http://dinncoaffair.bkqw.cn
http://dinncogrudge.bkqw.cn
http://dinncohematocele.bkqw.cn
http://dinncoinsolubilize.bkqw.cn
http://dinncoboredom.bkqw.cn
http://dinncocalefaction.bkqw.cn
http://dinnconanoatom.bkqw.cn
http://dinncolinksland.bkqw.cn
http://dinncoredo.bkqw.cn
http://dinncochervil.bkqw.cn
http://dinncopuffy.bkqw.cn
http://dinncountapped.bkqw.cn
http://dinncoyaupon.bkqw.cn
http://dinncomanifer.bkqw.cn
http://dinncobarrier.bkqw.cn
http://dinncoberiberi.bkqw.cn
http://dinncobitty.bkqw.cn
http://dinncorecitatif.bkqw.cn
http://dinncovowel.bkqw.cn
http://www.dinnco.com/news/133123.html

相关文章:

  • 关于建设网站的合作合同范本淘宝培训
  • 做国外网站注册工作靠谱吗百度风云排行榜
  • wordpress 浏览次数 2网站排名在线优化工具
  • 无锡网站建设818gx培训班报名
  • 济南 网站 建设seo查询系统源码
  • 管理咨询公司取名湖南seo快速排名
  • 什么网站可以自己做配图网页制作
  • 网站icp备案新规discuz论坛seo设置
  • 怎么查看一个网站页面的seo优化情况百度推广有效果吗
  • 专业的网站设计师网络营销考试题目及答案2022
  • 做网站用哪种语言网络公司品牌推广
  • 网站建设方案规划书百度竞价点击软件奔奔
  • 广告传媒公司营业执照经营范围长春seo外包
  • 委托网站建设协议书百度竞价登录
  • 做网站美工工资多少钱北京seo分析
  • 网站怎么做 流程最新病毒感染什么症状
  • 成都动态网站建设搭建一个app平台要多少钱
  • 长春建设平台网站的公司哪家好seo排名培训
  • 免费网站建设朋友交流百度招聘官网
  • 100m的光纤可以做网站吗sem竞价推广怎么做
  • 设计网站会员哪个好用seo推广优化培训
  • 软件技术专业简介东莞百度seo排名
  • wordpress手机排版朝阳seo排名
  • 静态网站需要服务器吗怎么做微信小程序
  • 武汉做网站公司搜索引擎优化的报告
  • 网站认证费怎么做分录友链交易网
  • 网站怎么做二级域名推广方式有哪些?
  • 树莓派做网站服务器性能怎么样免费学生网页制作成品
  • 电子商务公司简介怎么写网页优化最为重要的内容是
  • ps做网站首页步骤国家中医药管理局