学习Linux/GNU/C++/C过程中遇到的问题

学习Linux/GNU/C++/C过程中遇到的问题

  • 1.源函数调用:
  • 2.linux静态库使用:
  • 3.vscode创建c++程序调用onnxruntime:
      • 问题1:找不到头文件或者未定义函数
      • 问题2:error while loading shared libraries: libonnxruntime.so.1.16.1: cannot open shared object file: No such file or directory
      • 典型使用demo:
  • 4. c++调用c源程序注意及c/c++区别:
      • 1.c及c++函数签名不同:c++为了函数重载,同一函数签名根据参数不同而不同:

1.源函数调用:

    c++文件调用另一个cpp文件:函数声明在libtest.h中,函数定义在libtest.cpp中,则test.cpp调用libtest.h中声明的函数时,使用#include "libtest.cpp"而不是“libtest.h”,否则出现函数未调用。c++调用c文件则include xxx.h头文件。

2.linux静态库使用:

    g++ -c libtest.cpp -o libtest.o编译源文件为目标文件.o

    ar rcs libtest.a libtest.o由.o目标文件生成静态库

    g++ test.cpp -o test -static -L.编译test.cpp,在test.cpp中include"libtest.cpp",-static指示使用静态链接,-L.指示在当前文件夹查找所需库文件,在-L.后加上 -lerr则便是在当前命令下查找库文件liberr,可使用file test查看是否成功静态链接

    运行./test可执行文件

3.vscode创建c++程序调用onnxruntime:

问题1:找不到头文件或者未定义函数

解决1:在task.json文件的args部分加上:
            "-I/tao/code/package/onnxruntime/include",//大写I表示include目录
            "-L/tao/code/package/onnxruntime/lib",//大写L表示.so共享库目录
            "-lonnxruntime",//小写l为lib库名称,库目录中文件全名为libonnxruntime.so,这里用l来表示lib
            最后:注意task或c_cpp_properties.json中编译器命令是否为g++,不用gcc;

问题2:error while loading shared libraries: libonnxruntime.so.1.16.1: cannot open shared object file: No such file or directory

解决2:tasks.json内指定库目录即名称任然报错,因为默认情况下,编译器只会使用/lib和/usr/lib这两个目录下的库文件.
通常通过源码包进行安装时,如果不指定–prefix,提示找不到相关的.so库,会报错。也就是说,.so文件目录不在系统默认的库搜索目录中,需要将目录加进去.
配置文件在:/etc/ld.so.conf文件中,将所在的库目录加入到共享库的配置文件中:执行vi /etc/ld.so.conf,在"include ld.so.conf.d/*.conf"下方增加/tao/code/package/onnxruntime/lib。
保存后,在命令行终端执行:/sbin/ldconfig -v和ldconfig.
其作用是将文件/etc/ld.so.conf列出的路径下的库文件缓存到/etc/ld.so.cache以供使用.
因此当安装完一些库文件,或者修改/etc/ld.so.conf增加了库的新搜索路径,需要运行一下ldconfig,
使所有的库文件都被缓存到文件/etc/ld.so.cache中,如果没做,可能会找不到刚安装的库。

典型使用demo:

#include <onnxruntime_cxx_api.h>

#include <cmath>
#include <algorithm>
#include <iostream>
#include <iomanip>

//#pragma comment(lib, "user32.lib")
//#pragma comment(lib, "gdi32.lib")
//#pragma comment(lib, "onnxruntime.lib")

template <typename T>
static void softmax(T& input) {
    float rowmax = *std::max_element(input.begin(), input.end());
    std::vector<float> y(input.size());
    float sum = 0.0f;
    for (size_t i = 0; i != input.size(); ++i) {
        sum += y[i] = std::exp(input[i] - rowmax);
    }
    for (size_t i = 0; i != input.size(); ++i) {
        input[i] = y[i] / sum;
    }
}

// This is the structure to interface with the MNIST model
// After instantiation, set the input_image_ data to be the 28x28 pixel image of the number to recognize
// Then call Run() to fill in the results_ data with the probabilities of each
// result_ holds the index with highest probability (aka the number the model thinks is in the image)
struct MNIST {
    MNIST() {
        auto memory_info = Ort::MemoryInfo::CreateCpu(OrtDeviceAllocator, OrtMemTypeCPU);
        input_tensor_ = Ort::Value::CreateTensor<float>(memory_info, input_image_.data(), input_image_.size(),input_shape_.data(), input_shape_.size());
        output_tensor_ = Ort::Value::CreateTensor<float>(memory_info, results_.data(), results_.size(),output_shape_.data(), output_shape_.size());
    }
    std::ptrdiff_t Run() {
        const char* input_names[] = { "Input3" };
        const char* output_names[] = { "Plus214_Output_0" };

        Ort::RunOptions run_options;
        session_.Run(run_options, input_names, &input_tensor_, 1, output_names, &output_tensor_, 1);
        softmax(results_);
        result_ = std::distance(results_.begin(), std::max_element(results_.begin(), results_.end()));
        return result_;
    }
    static constexpr const int width_ = 28;
    static constexpr const int height_ = 28;
    std::array<float, width_* height_> sneakers = { 0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0039,0.0078,0.0000,0.0000,0.0000,0.0000,0.0000,0.2431,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0431,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.5725,0.6902,0.4510,0.7137,0.1137,0.0000,0.0000,0.0000,0.0157,0.0000,0.0000,0.4588,0.7922,0.0471,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0078,0.0039,0.0000,0.0000,0.0000,0.1333,0.9255,0.5765,0.4941,0.4392,0.6392,0.6902,0.0000,0.0000,0.0000,0.0000,0.0000,0.3647,0.8000,0.8510,0.2039,0.0000,0.0000,0.0000,0.0039,0.0000,0.0039,0.0000,0.0000,0.0000,0.0235,0.1176,0.9255,0.4902,0.4627,0.2824,0.4078,0.4510,0.4784,0.7451,0.9333,0.4588,0.1451,0.1255,0.3569,0.7804,0.7843,0.6667,0.0980,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.2392,0.2392,0.7412,0.6392,0.3137,0.3216,0.4314,0.4941,0.4941,0.5294,0.5333,0.4510,0.6863,0.8667,0.8392,0.7922,0.8667,0.7529,0.5294,0.7412,0.1529,0.0000,0.0000,0.0000,0.0000,0.0000,0.1412,0.2039,0.5843,0.7412,0.2549,0.2980,0.3922,0.4353,0.4510,0.4627,0.4745,0.5020,0.5333,0.4784,0.3529,0.3804,0.5333,0.6706,0.6745,0.4118,0.3529,0.8667,0.1294,0.1451,0.4902,0.4039,0.4353,0.4863,0.5059,0.4353,0.3333,0.3804,0.4667,0.4588,0.4039,0.4196,0.4471,0.5333,0.6275,0.6745,0.7098,0.7373,0.7725,0.7294,0.5765,0.4353,0.3686,0.4392,0.6667,0.7961,0.2980,0.5569,0.7373,0.7098,0.7098,0.6980,0.6392,0.5882,0.4941,0.4078,0.4196,0.5490,0.6314,0.7373,0.8000,0.8353,0.8667,0.8824,0.8824,0.8549,0.8196,0.5725,0.7804,1.0000,0.9882,0.8235,0.8196,0.8078,0.1569,0.2275,0.4863,0.6000,0.6667,0.7176,0.7373,0.6824,0.7137,0.6549,0.7843,0.8275,0.8118,0.8000,0.7412,0.7647,0.5843,0.3333,0.4078,0.7294,0.0000,0.0000,0.0000,0.0510,0.0902,0.0902,0.0471,0.0235,0.0706,0.0588,0.1059,0.0078,0.0078,0.0196,0.0510,0.1843,0.2706,0.5569,0.2784,0.0980,0.0235,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.1059,0.2824,0.0980,0.0902,0.0784,0.0431,0.0471,0.0902,0.1451,0.1843,0.0000,0.1137,0.2706,0.2863,0.2667,0.2039,0.0314,0.2235,0.1333,0.0000,0.0235,0.1020,0.1529,0.1529,0.1882,0.2235,0.2275,0.2118,0.1059,0.2549,0.3373,0.1529,0.1725,0.1608,0.1686,0.2118,0.2588,0.1843,0.0000,0.0000,0.0000,0.0000,0.1412,0.1765,0.1765,0.2863,0.2157,0.2863,0.3137,0.2588,0.2392,0.2314,0.1882,0.1529,0.1686,0.1765,0.2000,0.1725,0.2314,0.1608,0.1765,0.2275,0.2275,0.1765,0.1412,0.0039,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000
    };
    std::array<float, width_* height_> input_image_ = sneakers;
    std::array<float, 10> results_{};
    int64_t result_{ 0 };
private:
    Ort::Env env;
    Ort::Session session_{ env, "mnist.onnx", Ort::SessionOptions{nullptr} };
    Ort::Value input_tensor_{ nullptr };
    std::array<int64_t, 4> input_shape_{ 1, 1, width_, height_ };
    Ort::Value output_tensor_{ nullptr };
    std::array<int64_t, 2> output_shape_{ 1, 10 };
};
using namespace std;
int main(void)
{
    char* labellist[10] = { "T - shirt" ," pants "," pullover","qunzhi"," coat"," sandals "," shirt","yundongxie","bag","ankle boots" };
    struct MNIST *mnist = new MNIST();
     mnist->Run();
    cout << setiosflags(ios::fixed)<<setprecision(5);
    std::cout << "result0:" << mnist->results_[0]<<endl;
    std::cout << "result1:" << mnist->results_[1] << endl;
    std::cout << "result2:" << mnist->results_[2] << endl;
    std::cout << "result3:" << mnist->results_[3] << endl;
    std::cout << "result4:" << mnist->results_[4] << endl;
    std::cout << "result5:" << mnist->results_[5] << endl;
    std::cout << "result6:" << mnist->results_[6] << endl;
    std::cout << "result7:" << mnist->results_[7] << endl;
    std::cout << "result8:" << mnist->results_[8] << endl;
    std::cout << "result9:" << mnist->results_[9] << endl;
    std::cout << "over" << endl;
    cout << "the result:  " << mnist->result_ << endl;
    cout << "the result:  " << labellist[mnist->result_] << endl;
    return 0;

4. c++调用c源程序注意及c/c++区别:

1.c及c++函数签名不同:c++为了函数重载,同一函数签名根据参数不同而不同:

//libtest.c文件
#include <stdio.h>
#include "libtest.h"
int area(int x,int y)
{
return x*y;
}

使用gcc -c libtest.c -o libtest.o生成目标文件后使用objdump -t libtest.o查看函数签名:
在这里插入图片描述

//libtest.cpp
#include <iostream>
#include "libtest.h"
using namespace std;
int area(int x,int y)
{
    cout<<"result"; 
    return x*y;
}

使用g++ -c libtest.cpp -o libtest.o生成目标文件,再使用objdump -t libtest.o查看,结果如下图。
可看到函数area的数字签名为Z4areaii,其中ii表示两个int类型的参数,如果是double的则是d。以此区别函数重载的各个函数。
因此cpp程序不能直接调用c程序,否则出现函数未定义。
在这里插入图片描述
如要在cpp中调用c程序,则在.h文件中使用extern “C”,对应的.c文件不变,如图:最开始#ifdef判断是否是g++编译器,因为c++编译器默认定义了__cplusplus符号,extern "C“指示c++编译器按c的方式生成函数签名,extern "C”不能被c编译器编译,所以用#ifdef判断。libtest.c和libtest.h如下所示:
在这里插入图片描述

gcc -c libtest.c -o libtest.o生成目标文件
ar cr -o libtest.a libtest.o生成静态库
gcc -o main main.cpp -L. -ltest -lstdc++//main.cpp会用libtest.a静态库,因为使用的gcc编译器c++,因此指明使用stdc++库
./main即可正常运行

使用 ldd main可查看对应的库:stdc++,使用g++编译c++程序会自动指明使用该库,使用gcc则单独指明-lstdc++
即gcc -c libtest.cpp -o libtest.o -lstdc++
在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:/a/110431.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

linux的使用学习(1)

Linux 修改root密码 1.以 root 用户或具有 sudo 权限的登录到 Linux 系统。 2.打终端&#xff0c;并执行以下命令以更改 root 用户的密码&#xff1a; sudo passwd root 3.然后&#xff0c;系统会要求你输入新的 root 密码。请注意&#xff0c;在输入密码时&#xff0c;终端界…

[毕设记录]@学术技能积累:zotero、readpaper 引用功能使用

文章目录 zoteroreadpaper 开题要在word里插入文献引用&#xff0c;zotero和readpaper在浏览器和word都有插件&#xff0c;比较好用 zotero Zotero 是一个免费、开源的参考文献管理软件&#xff0c;可以帮助用户收集、整理和引用文献。它支持多种操作系统&#xff0c;包括 Wind…

算法通关村第十二关黄金挑战——最长公共前缀问题解析

大家好&#xff0c;我是怒码少年小码。 最长公共前缀 LeetCode 14&#xff1a;编写一个函数来查找字符串数组中的最长公共前缀。 如果不存在公共前缀&#xff0c;返回空字符串 “”。 示例&#xff1a; 输入&#xff1a;strs [“flower”,“flow”,“flight”]输出&#xff…

网际协议IP

网际协议IP 一、IP地址 1、分类的IP地址 IP地址::{<网络号>,<主机号>} 2、无分类编址CIDR IP地址::{<网络前缀>,<主机号>} &#xff08;1&#xff09;网络前缀 ​ 与分类IP最大的区别就是网络前缀的位数n是不固定的&#xff0c;可以是0~32位。 ​ …

Day 11 python学习笔记

模块 内置模块 random random&#xff1a;随机数模块 我们可以在解释器中看到其蕴含的方法 接下来我解释一些常用的方法&#xff1a; random.random( ) random.random( ) 返回0-1的随机数 [0,1) >>> random.random() 0.364183511476754 random.randint(n,m) r…

Team AI:简化繁琐日常任务,打造团队智能协作

在过去的几个月里&#xff0c;我的同事们&#xff08;Thoughtworker&#xff09;一直在构建 Team AI 项目&#xff0c;一个围绕于 AIGC 辅助开发团队的野心勃勃的计划。在内部&#xff0c;我们还有一个名为 Team AI Hackathon 的活动&#xff0c;基于一个内部的 Team AI 代码库…

CCS3列表和超链接样式

在默认状态下&#xff0c;超链接文本显示为蓝色、下画线效果&#xff0c;当鼠标指针移过超链接时显示为手形&#xff0c;访问过的超链接文本显示为紫色&#xff1b;而列表项目默认会缩进显示&#xff0c;并在左侧显示项目符号。在网页设计中&#xff0c;一般可以根据需要重新定…

使用Llama index构建多代理 RAG

检索增强生成(RAG)已成为增强大型语言模型(LLM)能力的一种强大技术。通过从知识来源中检索相关信息并将其纳入提示&#xff0c;RAG为LLM提供了有用的上下文&#xff0c;以产生基于事实的输出。 但是现有的单代理RAG系统面临着检索效率低下、高延迟和次优提示的挑战。这些问题在…

答题小程序源码个人每日答题怎么做

答题小程序源码之个人每日答题怎么做 该模式以个人学习答题的方式进行答题&#xff0c;每人每天有X次答题机会&#xff0c;答对一题得X分&#xff0c;连续答对有额外奖励积分&#xff0c;每道题有倒计时X秒的思考时间。答题完成后领取本次的奖励积分。答题过程中如发现题目或答…

3D模拟场景开发引擎

在3D工程模拟开发中&#xff0c;有一些专门的引擎和工具可供选择&#xff0c;以帮助您创建逼真的三维模拟和模型。以下是一些用于3D工程模拟的开发引擎和工具&#xff0c;希望对大家有所帮助。北京木奇移动技术有限公司&#xff0c;专业的软件外包开发公司&#xff0c;欢迎交流…

matlab 布尔莎七参数坐标转换模型

目录 一、算法原理二、代码实现三、结果展示本文由CSDN点云侠原创,原文链接。爬虫自重,把自己当个人。 一、算法原理 算法原理与实现代码已在免费文章:布尔莎七参数坐标转换模型一文中给出,不想看付费文章直接跳转即可。 二、代码实现 clc; clear; close all; %% --

C语言C位出道心法(一):基础语法

一:基础语法认知:|变量|常量|数据类型| 变量与常量,数据类型认知升维 C语言中各种变量的定义及数据类型的认知: 一般而言,在譬如C等高级编程语言中,我们定义不同的类型的变量,需要不同的数据类型来进行声明,不同类型的数据类型声明的变量占用的内存空间不一样; 而数据类型大致…

go中“哨兵错误”的由来及使用建议

“哨兵错误&#xff08;sentinel error&#xff09;”这个词的出处。之前我也只是在一些书籍和资料中见到过&#xff0c;也没深究。当这个网友问了我之后&#xff0c;就深入的翻了翻资料&#xff0c;在golang的官方博客中找到了这个词的提法&#xff0c;也算是比较官方的了吧。…

如何在外SSH远程连接Ubuntu系统【无公网IP】

如何在外SSH远程连接Ubuntu系统【无公网IP】 文章目录 如何在外SSH远程连接Ubuntu系统【无公网IP】前言1. 在Ubuntu系统下安装cpolar软件2. 完成安装后打开cpolar客户端web—UI界面3. 创建隧道取得连接Ubuntu系统公网地址4. 打开Windows的命令界面并输入命令 前言 随着科技和经…

酷开科技,让家庭更有温度!

生活中总有一些瞬间&#xff0c;会让我们感到无比温暖和幸福。一个拥抱、一句问候、一杯热茶&#xff0c;都能让我们感受到家庭的温馨和关爱。酷开科技也用自己的方式为我们带来了独属于科技的温暖&#xff0c;通过全新的体验将消费者带进一个充满惊喜的世界&#xff0c;让消费…

常见排序算法之堆排序

堆排序是一种利用堆这种数据结构所设计的一种排序算法。堆积是一个近似完全二叉树的结构&#xff0c;并同时满足堆积的性质&#xff1a;即子结点的键值或索引总是小于&#xff08;或者大于&#xff09;它的父节点。 需要注意的是排升序要建大堆&#xff0c;排降序建小堆…

SurfaceFliger与Vsync信号如何建立链接?

Vsync信号上报流程 Vsync的注册函数&#xff0c;来临时会回调HWComposer的hook_VSYNC方法&#xff0c;接着调用到vsync方法中 大致流程梳理&#xff1a; 该方法会通知给SurfaceFliger的onVsyncReceived方法&#xff0c;接着调用DispSync的addResyncSample方法。 DispSyncThr…

2023-在mac下安装Homebrew的国内镜像

mac安装Homebrew的国内镜像 尝试使用其他下载源&#xff1a;GitHub 可能会受到访问限制&#xff0c;尝试使用其他镜像或下载源。您可以使用清华大学、中科大或阿里云的 Homebrew 镜像&#xff0c;以提高下载速度和可靠性。例如&#xff0c;可以使用阿里云的镜像来安装 Homebre…

window系统修改rabbitmq 默认端口

安装完rabbitmq之后&#xff0c;默认的client端口是5672, 控制台访问端口是15672&#xff0c;rabbitmq管理工具启动之后在浏览器中输入地址&#xff1a; ​ ​http://localhost:15672/​​​ 就可以访问后台​ ​​​&#xff0c; 默认管理员账号&#xff1a;guest 密码&#x…

虚拟化、容器与Docker基本介绍以及安装部署(Docker 基本管理)

虚拟化、容器与Docker基本介绍以及安装部署&#xff08;Docker 基本管理&#xff09; 1、Docker 概述1.1Docker与虚拟机的区别1.2容器在内核中支持2种重要技术&#xff1a;1.3Docker核心概念 2、安装docker服务docker安装步骤详解 3、 网络优化4、docker基本命令4.1查看镜像——…