D
Danzellen
Guest
I'm currently trying to send a text message using the Twilio example of how to send a SMS message in C__.
I was able to get it running on Linux just fine, but I want to integrate this into my app using Visual Studios. I've made some changes to the code in order to hardcode the number and remove the need for arguments.
Currently, this is the error I'm receiving:
twilio.obj : error LNK2001: unresolved external symbol "public: static class std::locale::id std::codecvt<char16_t,char,struct _Mbstatet>::id" (?id@?$codecvt@_SDU_Mbstatet@@@std@@2V0locale@2@A)
I believe it's related to the type_conversion.h file:
#include <locale>
#include <codecvt>
#include <string>
#include <iostream>
// Given a UTF-8 encoded string return a new UCS-2 string.
inline std::u16string
utf8_to_ucs2(std::string const& input)
{
std::wstring_convert<std::codecvt_utf8<char16_t>, char16_t> convert;
try {
return convert.from_bytes(input);
}
catch (const std::range_error&) {
throw std::range_error(
"Failed UCS-2 conversion of message body. Check all "
"characters are valid GSM-7, GSM 8-bit text, or UCS-2 "
"characters."
);
}
}
// Given a UCS-2 string return a new UTF-8 encoded string.
inline std::string
ucs2_to_utf8(std::u16string const& input)
{
std::wstring_convert<std::codecvt_utf8<char16_t>, char16_t> convert;
return convert.to_bytes(input);
}
I'm pretty sure this is the only problem, since I was able to get curl running and found a replacement for the unistd.h file. Is there a way to fix this error? Thanks!
Continue reading...
I was able to get it running on Linux just fine, but I want to integrate this into my app using Visual Studios. I've made some changes to the code in order to hardcode the number and remove the need for arguments.
Currently, this is the error I'm receiving:
twilio.obj : error LNK2001: unresolved external symbol "public: static class std::locale::id std::codecvt<char16_t,char,struct _Mbstatet>::id" (?id@?$codecvt@_SDU_Mbstatet@@@std@@2V0locale@2@A)
I believe it's related to the type_conversion.h file:
#include <locale>
#include <codecvt>
#include <string>
#include <iostream>
// Given a UTF-8 encoded string return a new UCS-2 string.
inline std::u16string
utf8_to_ucs2(std::string const& input)
{
std::wstring_convert<std::codecvt_utf8<char16_t>, char16_t> convert;
try {
return convert.from_bytes(input);
}
catch (const std::range_error&) {
throw std::range_error(
"Failed UCS-2 conversion of message body. Check all "
"characters are valid GSM-7, GSM 8-bit text, or UCS-2 "
"characters."
);
}
}
// Given a UCS-2 string return a new UTF-8 encoded string.
inline std::string
ucs2_to_utf8(std::u16string const& input)
{
std::wstring_convert<std::codecvt_utf8<char16_t>, char16_t> convert;
return convert.to_bytes(input);
}
I'm pretty sure this is the only problem, since I was able to get curl running and found a replacement for the unistd.h file. Is there a way to fix this error? Thanks!
Continue reading...