V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  wjx0912  ›  全部回复第 18 页 / 共 41 页
回复总数  808
1 ... 14  15  16  17  18  19  20  21  22  23 ... 41  
大丈夫能屈能伸,何况道个歉又不吃亏
2023-07-24 16:54:45 +08:00
回复了 sbldehanhan 创建的主题 Linux 有什么推介的终端管理软件?
windows 盗版 xshell ,mac 开源 tabby
2023-07-24 14:25:20 +08:00
回复了 yaott2020 创建的主题 程序员 感觉 rust 门槛太高了
搬砖:包工头时不时抽你一鞭子
写 rust:编译器时不时抽你一鞭子
2023-07-21 08:33:03 +08:00
回复了 webberone 创建的主题 程序员 win 台式和 mac mini 纠结
一手 16g 不如二手 32g
2023-07-17 17:18:44 +08:00
回复了 wjx0912 创建的主题 C++ c++ cmake 动态库的 std::string 为空,求指点(maocs-12.6)
@ysc3839 谢谢
2023-07-17 17:00:15 +08:00
回复了 wjx0912 创建的主题 C++ c++ cmake 动态库的 std::string 为空,求指点(maocs-12.6)
@zpd2009 谢谢。还是运行时没完全理解。但这种坑对新手实在是不友好
2023-07-17 16:58:45 +08:00
回复了 wjx0912 创建的主题 C++ c++ cmake 动态库的 std::string 为空,求指点(maocs-12.6)
2023-07-17 16:44:12 +08:00
回复了 wjx0912 创建的主题 C++ c++ cmake 动态库的 std::string 为空,求指点(maocs-12.6)
@Shatyuka windows 的 DllMain.DLL_PROCESS_ATTACH 执行的比较晚,所以不会有这个问题,对吧
2023-07-17 16:42:39 +08:00
回复了 wjx0912 创建的主题 C++ c++ cmake 动态库的 std::string 为空,求指点(maocs-12.6)
@Shatyuka 正解。谢谢
2023-07-17 16:41:28 +08:00
回复了 wjx0912 创建的主题 C++ c++ cmake 动态库的 std::string 为空,求指点(maocs-12.6)
@chingyat 嗯。这个是没问题的。但是 g_test 不是固定值(会从文本读取)。runtime 执行一堆 constructor 的顺序问题。
2023-07-17 16:39:33 +08:00
回复了 wjx0912 创建的主题 C++ c++ cmake 动态库的 std::string 为空,求指点(maocs-12.6)
这个不是编译器 bug ,是未指定行为
2023-07-17 16:37:17 +08:00
回复了 wjx0912 创建的主题 C++ c++ cmake 动态库的 std::string 为空,求指点(maocs-12.6)
```
搞定了,把:
std::string g_test1;
std::string g_test2;
改成:
__attribute__((init_priority(101))) std::string g_test1;
__attribute__((init_priority(101))) std::string g_test2;

参考:
https://stackoverflow.com/questions/43941159/global-static-variables-initialization-issue-with-attribute-constructor-i
```
2023-07-17 16:17:24 +08:00
回复了 wjx0912 创建的主题 C++ c++ cmake 动态库的 std::string 为空,求指点(maocs-12.6)
猜测的原因:__attribute__((constructor))时,c++ runtime 还未初始化,std::string 的一些操作可能不稳定。

测试:
```
std::string g_test1;
std::string g_test2;

__attribute__((constructor))
static void init() {
g_test1 = "hello test1";
printf("init: %s\n", g_test1.c_str());
}

void hello_func1(void) {
g_test2 = "hello test2";
printf("Hello World: %s, %s\n", g_test1.c_str(), g_test2.c_str());

return;
}

void hello_func2(void) {
printf("Hello World: %s, %s\n", g_test1.c_str(), g_test2.c_str());

return;
}
```

在 hello_func2 里面,g_test1 无法打印,g_test2 正常。

不知道这个思路是否正确,求大神指点
2023-07-14 15:33:48 +08:00
回复了 BigBurNing 创建的主题 程序员 618 没赶上,现在想装机了,伙伴们给点建议吧
不缺那一百块的话,13600KF -> 13600K
2023-07-14 11:30:42 +08:00
回复了 XSDo 创建的主题 程序员 三年网课,产出了一大批有证,能力一般的毕业生?
你这 hr 的 kpi 不给满分委屈了,直接写邮件,让老板给他加工资
2023-07-14 11:06:08 +08:00
回复了 aguaiabcdef 创建的主题 程序员 想装个台式机,希望各位给点意见
内存太小了。我 10700 黑苹果都配了 64g
厉害了
2023-07-13 09:07:55 +08:00
回复了 random1221 创建的主题 问与答 Chrome 如何禁止在新建 tab 时显示书签或历史记录?
上面的软件全试了一遍,tabby cat 比较好用
2023-07-10 18:23:14 +08:00
回复了 liuchengfeng1 创建的主题 程序员 成都 3 年多 Vuer 前端求坑位~
感觉不错。只是简历太长看的累。18-25k 没问题
2023-07-10 11:18:37 +08:00
回复了 liulei281 创建的主题 程序员 销售和开发的项目提成比例 8:1:1,这合理吗?
楼主得说下什么项目,特定场景还是终端用户。如果对接的资源稀缺难搞,别说占 8 ,占 10 都合理
1 ... 14  15  16  17  18  19  20  21  22  23 ... 41  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1303 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 28ms · UTC 17:40 · PVG 01:40 · LAX 10:40 · JFK 13:40
Developed with CodeLauncher
♥ Do have faith in what you're doing.