开发者

String.h Errors From g++ Compilation

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): 开发者_如何学Goundefined 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?


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜