ICode9

精准搜索请尝试: 精确搜索
  • G%GH04 本地连接至远程2022-06-03 13:01:10

    注意事项与声明 平台: Windows 10 作者: JamesNULLiu 邮箱: jamesnulliu@outlook.com 博客: https://www.cnblogs.com/jamesnulliu 学习笔记 转载请注明出处 欢迎留言 0. 前言 本系列文章是 git & github 的入门教程. 本系列文章优势: 零基础 深入浅出 知识点涵盖面广 本系列其

  • c-OSX中动态库的Ctypes“找不到符号”2019-12-10 02:57:58

    我制作了一个C库,并从中建立了一个.dylib动态库.但是,当我使用ctypes加载它时,它会失败.似乎没有正确链接.我不知道为什么.错误(相关部分): cscalelib.setup_framebuffer(flip,surface.frame_buffer,surface.texture,surface._scale[0],surface._scale[1]) File "/Library/Fr

  • c-警告:从“ long int”转换为“ double”可能会更改其值2019-12-01 20:52:02

    我的代码如下: #include <iostream> #include <sys/time.h> using namespace std; int main(int argc, char** argv) { if(argv[0]) argc++; struct timeval m_timeEnd, m_timeCreate, m_timeStart;

  • c-有没有办法找出在Linux上编译.so库时使用的编译器选项?2019-12-01 17:51:37

    我需要知道如何编译我的库,即使用了哪些编译器选项?具体来说,无论是否经过优化编译以及其他选项很少. 有什么方法可以在Linux x86_64平台上提取此信息?解决方法:我不认为有可能自动检测编译器选项.至少不是以便携式的方式. 相反,您可以做的是更改构建脚本(例如您的Makefile),以将定义

  • c-如何编译独立的OpenCV可执行文件?2019-12-01 04:51:16

    我按如下方式编译我的OpenCV程序: g++ `pkg-config --cflags opencv --libs opencv` <filename>.cpp 它在我的计算机上完美运行.我可以单独将共享库与程序一起编译,以便可以在没有opencv的其他计算机上运行吗?如果是这样,我该怎么办?解决方法:编译过程中的程序会动态链接到我们计算

  • c-为什么boost :: timer这样奇怪的结果?2019-11-23 02:50:36

    为什么boost :: timer给我这么奇怪的结果? 我的工作解决方案是对< time.h>中的gettimeofday函数使用包装器,但是我不明白为什么boost :: timer在这里对我不起作用.我做错了什么? class Timer { private: timeval startTime; public: void start(){ gettimeofday(

  • python-Cython的C API声明失败2019-11-22 01:09:52

    我有两个文件module.pyx和foo.cpp.我希望能够调用在cython模块module.pyx中声明的foo.cpp中的函数.此函数返回指向矢量的指针: module.pyx: #distuils: language = c++ from libcpp.vector cimport vector from cython.operator cimport dereference as deref cdef api vector[int

  • c-使用-mpopcnt编译会导致非法指令错误2019-11-20 18:01:36

    我编译以下C代码 // main.cpp #include <cstdio> int main() { unsigned char tab[4] = {0}; printf("%d\n", __builtin_popcount(*((int *)tab))); } 使用命令行: g++ -o prog main.cpp -mpopcnt 运行程序时出现错误: Illegal instruction 不使用-mpopcnt进行编译不会产

  • c-共享库和libpthread.so的g问题2019-11-19 16:50:36

    我在这个问题上碰壁了,希望在这里能找到一些帮助.我创建了一个小示例可执行文件和共享库来展示该问题. 抱歉,我意识到这变成了文字墙,但是我试图确保包含所有相关信息. 我的设定 System: CentOS release 5.11 (Final) g++: gcc version 4.4.7 20120313 (Red Hat 4.4.7-1) (GCC) l

  • 从python编译cpp失败但不在shell中2019-11-18 04:55:48

    我有一个cpp文件,可以使用shell用g很好地编译它: extern "C"{ #include <quadmath.h> } inline char* print( const __float128& val) { char* buffer = new char[128]; quadmath_snprintf(buffer,128,"%+.34Qe", val); return buffer; } int main(){

  • 在MAC OS X 10.6上使用MySQL C API编译问题2019-11-06 17:15:28

    我在使用MySQL C API和Mac OS X 10.6时遇到问题.当我想编译一个SQL客户端程序时,它会因该错误消息而中止 ld: library not found for -lmysqlclient collect2: ld returned 1 exit status 我用以下命令编译: g++ -I /usr/local/mysql/include/ -L /usr/local/mysql/lib/ -lmysq

  • linux-无法使用g进行编译2019-10-31 16:50:32

    现在,我尝试使用一种名为“ GAUL”的开源工具,其中实现了一些遗传算法.通过编译示例文件,我发现只能使用gcc来编译这些数据,而不能使用g来编译. E.x .: 1)使用gcc -I /usr/local/include / -c wildfire_threat.c -o test.o gcc ** -g -O2 -Wall -o test2.out test.o -lgaul -lgaul_u

  • c-将源与反汇编代码匹配2019-10-29 16:50:32

    作为我的工作的一部分,我经常必须分析带有/不带有核心转储的不可复制的零售崩溃.我一般配备 >调用堆栈,崩溃时的注册表信息,单一信息 >实际负载模块>匹配源代码 通常,基于偏移量并通过objdump生成反汇编,我计算失败的指令(机器代码/汇编代码). 下一个工作是乏味的.我尝试将失败的指

  • c-linux上的AVX分段错误2019-10-27 19:52:03

    我正在尝试运行此代码,并且在运行它时显示分段错误.它编译良好.这是代码. (在Windows上正常工作). #include<iostream> #include<vector> #include<immintrin.h> const int size = 1000000; std::vector<float>A(size); std::vector<float>B(size); std::vector<float>C(size

  • c-SIGBUS何时使用新的安置?2019-10-25 10:50:51

    我有以下代码(已更新): #include <iostream> #include <cassert> #include <errno.h> #include <string.h> #include <sys/mman.h> #include <fcntl.h> #include <new> struct S { uint32_t a; uint32_t b; }; int main() { const au

  • c-静态链接库时,出现链接器错误:找不到-lgcc_s2019-10-25 02:51:28

    我想静态链接库说libcurl.由于静态库和共享库都在同一文件夹中,因此我在使用-Wl,-Bstatic来使链接程序知道使用静态库. g++ -o prog prog.o -Wl,-Bstatic -lcurl. 但是上面的命令给出了错误: /usr/bin/ld: cannot find -lgcc_s 如果我排除-Wl,-Bstatic,它可以正常工作,但是它将

  • linux-如何使我的Makefile更好?2019-10-14 01:51:15

    我正在尝试学习项目的“最佳实践” makefile. 请在下面查看我的Makefile文件,并提出更改建议以增强它. 目录布局: root dir --- Makefile deps --- deps bin --- binary objs --- all .o files include --- all .h files src --- all .c .cc files 生成文件: # # Generic ma

  • 非常基本的正则表达式方案与libstdc -v3上的预期不同2019-10-13 22:15:08

    我得到的行为与我的预期不同(并且与Microsoft C有所不同). 考虑以下test.cpp文件: #include <iostream> #include <ostream> #include <regex> int main( void ) { std::regex rx( "a(b+)(c+)d" ); std::string s( "abbbbccd" ); std::smatch m;

  • C int转换为字符串,连接字符串2019-10-13 10:07:14

    这个问题已经在这里有了答案:            >            How to concatenate a std::string and an int?                                    22个 我是C语言的新手,正在从事一个简单的项目.基本上,我遇到问题的地方是

  • c-两个模板类由彼此组成2019-10-13 09:07:34

    我的代码中需要两个模板类由彼此的成员字段组成.例如,我有两个文件, templates.h template <class T> class B; template <class T> class A { B<A> a; // fields and methods dependent on T }; template <class T> class B { A<B> b; // fields and me

  • c-如果它们具有私有副本构造函数,为什么不能初始化对象数组?2019-10-12 22:09:45

    在执行C项目时,我遇到了一些意外的和令人沮丧的行为.我的实际代码有点复杂,但是以下示例也将其捕获: class Irritating { public: Irritating() {} private: Irritating(const Irritating& other) {} }; const Irritating singleton; // Works just fine.

  • C计算时间间隔2019-10-12 13:08:38

    我想计算程序中发生的某些事件之间的时间间隔(以1秒的1/10为单位).因此,我将时钟功能用于这些需求,如下所示: clock_t begin; clock_t now; clock_t diff; begin = clock(); while ( 1 ) { now = clock(); diff = now - begin;

  • c-g如何不报告给定代码的错误?2019-10-12 11:06:50

    这是我对why is elapsedtime giving me an output of 1?的回答的继续 我能够使用g 4.7.3成功编译并构建以下程序. #include <iostream> using namespace std; int elapsedtime(int time1, int time2) { return (time2-time1); } int main() { int time1; int time2;

  • c-禁用有关在派生类的复制构造函数中显式初始化基本构造函数的警告2019-10-12 08:07:27

    我正在使用启用-Wextra的g版本4.2.1.我包括一个库的标头,并且我不断收到有关库中类的以下警告,该警告由-Wextra启用(我已用BaseClass替换了类的实际名称): warning: base class ‘class BaseClass’ should be explicitly initialized in the copy constructor 我的问题是:如何禁用

  • c-尾递归未发生2019-10-12 08:06:32

    我在C项目中使用g(Ubuntu 4.8.2-19ubuntu1)4.8.2.我写了一个函数来做到这一点: template<typename T, T (*funct)(int) > multiset<T> Foo(const multiset<T>& bar, int iterations) { if (iterations == 0) return bar; multiset<T> copy_bar(bar);

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有