c
hkNaruto
这个作者很懒,什么都没留下…
展开
-
linux c shared library 动态链接库 开发 调用 笔记 普通工程 gnu autotools工程 报错undefined reference
即:Gnu Autotools Project链接动态库造成undefined reference to `mysharedlibraryfunc'的根本原因在于-l参数(-lmysharedlibrary)应该排在gcc指令追后,不能在a_out-test.o参数之前!gcc 11.4.0的bug? 采用clang 16.0解决。原创 2023-08-23 14:56:55 · 106 阅读 · 0 评论 -
Linux平台gnu C undefined reference to `CPU_ZERO‘
解决方案:文件头部添加宏定义 #define _GNU_SOURCE。原创 2022-12-12 10:42:11 · 1968 阅读 · 0 评论 -
Linux C fork函数使用
注意,fork()调用之后的代码两个进程都会执行,通过判断fork()返回值是否为0确认是否是子进程。说明,每一次fork,都会拷贝变量到新的进程,其进程看到的虚拟地址是一样的。原创 2022-08-25 14:56:02 · 101 阅读 · 0 评论 -
Feature ‘openssl-linked‘ was enabled, but the pre-condition ‘!features.securetransport && !features.
./configure -static -static-runtime -openssl-linkedNote: Also available for Linux: linux-clang linux-iccNote: Using static linking will disable the use of dynamicallyloaded plugins. Make sure to import all needed static plugins,or compile needed mo.原创 2021-03-19 11:20:44 · 5470 阅读 · 0 评论 -
CryptoJS C/C++ openssl Java AES_256_ecb 加密解密互通
CryptoJS<script type="text/javascript" src="crypto-js.js"></script><script type="text/javascript"> // 加密 var ciphertext = CryptoJS.AES.encrypt(CryptoJS.enc.Utf8.parse('123456'), CryptoJS.enc.Utf8.parse('123456789012345原创 2021-03-01 16:26:50 · 1670 阅读 · 2 评论 -
gnu C/C++ C语言十六进制打印缓冲区内容
void printhexDump(const char *buffer, size_t len){ if (buffer == NULL || len <= 0) { return; } printf("0x%x: [", buffer); for (size_t i = 0; i < len; i++) { printf("%.2X ", (unsigned char)buffer[i]); } .原创 2020-06-18 10:58:46 · 1597 阅读 · 0 评论 -
‘strncpy’ output truncated before terminating nul copying as many bytes from a string as its length
错误信息:In function ‘AllocString’, inlined from ‘SetData’ at /home/yeqiang/Downloads/openjdk-jdk-14-23/src/java.desktop/share/native/liblcms/cmscgats.c:1586:47, inlined from ‘cmsIT8SetDataRowC...原创 2019-11-28 16:48:21 · 6101 阅读 · 2 评论 -
x86_64 架构下int long加法运算性能对比
编写int_long_performance.c代码如下#include <stdio.h>#include <time.h>#include <stdlib.h>void main(){ time_t c_start, c_end; unsigned int i=0; unsigned long l=0; printf("int size=...原创 2019-11-06 13:52:07 · 591 阅读 · 0 评论 -
GmSSL Android NDK编译 (版本95c0dba)
下载源码并切换到版本95c0dba[yeqiang@localhost tmp]$ git clone https://github.com/guanzhi/GmSSL.gitCloning into 'GmSSL'...remote: Counting objects: 13557, done.remote: Total 13557 (delta 0), reused 0 (delta原创 2018-02-07 10:25:16 · 2265 阅读 · 4 评论 -
Linux C 程序性能测试 valgrind callgrind分析函数耗时、perf分析函数CPU消耗
利用valgrind callgrind分析函数时间消耗(尤其在有网络、磁盘等有IO操作下,分析调用时间。在被IO阻塞情况下,不会明显占用CPU资源)编写测试程序#include #include void perf1() { unsigned int i = 0; while (i < 200) { int b = i++; } usleep原创 2018-01-18 14:16:13 · 7930 阅读 · 3 评论 -
VC 2013 openssl error C2065: “name”: 未声明的标识符 error C2296: “*”: 非法,左操作数包含“LPCSTR”类型
测试程序1:#include "stdafx.h"#include #include int _tmain(int argc, _TCHAR* argv[]){ X509_NAME *name = X509_NAME_new(); int i = name->modified; return 0;}编译输出:1>------ 已启动生成: 项目: ConsoleA原创 2018-01-24 14:17:50 · 2432 阅读 · 0 评论 -
linux c pcre 正则匹配多个目标
#include #define OVECCOUNT 30void main() { char *in = "20171208121020Z 20171208121020Z\n20171208121020Z"; char *pattern = "(19|20)([\\d]{2})([0-1][0-9])([0-3][0-9])([0-2][0-9])([0-6][0-9原创 2018-01-03 11:55:56 · 1235 阅读 · 0 评论 -
查看GCC内置宏定义
[yeqiang@localhost ~]$ gcc -dM -E - < /dev/null #define __DBL_MIN_EXP__ (-1021)#define __UINT_LEAST16_MAX__ 0xffff#define __ATOMIC_ACQUIRE 2#define __FLT_MIN__ 1.17549435082228750797e-38F#define原创 2018-01-11 09:19:30 · 1937 阅读 · 0 评论