来自 g++ 的 String.h 错误汇编

发布于 2024-11-28 21:02:40 字数 1311 浏览 0 评论 0原文

我无法弄清楚 g++ 生成的以下 C++ 错误

/tmp/ccH0IPVU.o: In function `myAPP::mandatory_bitfield_t::to_s(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
myAPP.cpp:(.text._ZN3myAPP20mandatory_bitfield_t4to_sERSsSs[myAPP::mandatory_bitfield_t::to_s(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >)]+0x8c): undefined reference to `myAPP::to_s(unsigned char*, int)'
/tmp/ccH0IPVU.o: In function `myAPP::optional_bitfield_t::to_s(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
myAPP.cpp:(.text._ZN3myAPP19optional_bitfield_t4to_sERSsSs[myAPP::optional_bitfield_t::to_s(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >)]+0x8d): undefined reference to `myAPP::to_s(unsigned char*, int)'
collect2: ld returned 1 exit status

有谁知道这些错误是指什么以及如何修复它们?

I cannot make heads or tails of the following C++ error generated by g++

/tmp/ccH0IPVU.o: In function `myAPP::mandatory_bitfield_t::to_s(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
myAPP.cpp:(.text._ZN3myAPP20mandatory_bitfield_t4to_sERSsSs[myAPP::mandatory_bitfield_t::to_s(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >)]+0x8c): undefined reference to `myAPP::to_s(unsigned char*, int)'
/tmp/ccH0IPVU.o: In function `myAPP::optional_bitfield_t::to_s(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
myAPP.cpp:(.text._ZN3myAPP19optional_bitfield_t4to_sERSsSs[myAPP::optional_bitfield_t::to_s(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >)]+0x8d): undefined reference to `myAPP::to_s(unsigned char*, int)'
collect2: ld returned 1 exit status

Does anyone know what these errors are in reference to and how I can fix them?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

指尖上的星空 2024-12-05 21:02:40

据链接器所知,您忘记了包含(编译)myAPP::to_s(unsigned char*, int) 的定义。

我只是翻译错误消息。

干杯&嗯。

As far as the linker knows, you have forgotten to include (compile) a definition of myAPP::to_s(unsigned char*, int).

I'm just translating the error message.

Cheers & hth.

策马西风 2024-12-05 21:02:40

这实际上是一个链接器错误。

undefined reference to `myAPP::to_s(unsigned char*, int)

意味着您的代码正在某处调用 to_s 方法,但该方法的主体未包含在传递给链接器的对象文件中。

That is actually a linker error.

undefined reference to `myAPP::to_s(unsigned char*, int)

means that your code is calling the to_s method somewhere, but the body of this method was not included in the object files passed to the linker.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文