Lexical_cast and VC ExpresEdition 2010

Hi!
I use the line:
uint32_t& c;
string str("10);
[...]
c = lexical_cast

uint32_t& c; string str("10); [...] c = lexical_cast
(str); I obtaing link error with VC 2010 (I use the code::blocks IDE):
error LNK2019: riferimento al simbolo esterno "void __cdecl boost::throw_exception(class std::exception const &)" (?throw_exception@boost@@YAXABVexception@std@@@Z) non risolto nella funzione "unsigned int __cdecl boost::detail::lexical_cast
,0,char>(class std::basic_string const &,char *,unsigned int)" (??$lexical_cast@IV?$basic_string@DU?$char_LIBCMT.lib(wincrt0.obj)||error LNK2019: riferimento al simbolo esterno _WinMain@16 non risolto nella funzione ___tmainCRTStartup| LockFile.exe||fatal error LNK1120: 2 esterni non risolti
Do you compile with exception handling switched on (/GX compiler flag)?

On Mon, Nov 22, 2010 at 1:56 AM, Claude
uint32_t& c; string str("10); [...] c = lexical_cast
(str); I obtain link error with VC 2010 (I use the code::blocks IDE):
'c' looks like an uninitialized reference? With gcc 4.0.1 I can't even compile that declaration: error: 'c' declared as reference but not initialized I would expect *some* kind of error. Not sure why it would manifest as a link error with that compiler.

Hi there, just by looking at your code I can spot two things. First
"c" cannot be defined as reference without being assigned assigned to
some uint32_t instance. Second, there is an apostrophe missing when
creating the "str".
Please provide a small complete code sample that shows your problems.
Regards,
Christian
On Mon, Nov 22, 2010 at 1:56 AM, Claude
Hi!
I use the line:
uint32_t& c; string str("10); [...] c = lexical_cast
(str); I obtaing link error with VC 2010 (I use the code::blocks IDE):
error LNK2019: riferimento al simbolo esterno "void __cdecl boost::throw_exception(class std::exception const &)" (?throw_exception@boost@@YAXABVexception@std@@@Z) non risolto nella funzione "unsigned int __cdecl boost::detail::lexical_cast
,0,char>(class std::basic_string const &,char *,unsigned int)" (??$lexical_cast@IV?$basic_string@DU?$char_LIBCMT.lib(wincrt0.obj)||error LNK2019: riferimento al simbolo esterno _WinMain@16 non risolto nella funzione ___tmainCRTStartup| LockFile.exe||fatal error LNK1120: 2 esterni non risolti But the same code in GCC under Linux work well.
Why?
-- View this message in context: http://boost.2283326.n4.nabble.com/Lexical-cast-and-VC-ExpresEdition-2010-tp... Sent from the Boost - Users mailing list archive at Nabble.com. _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users

Yes, The code is incorrect... But now, with the "/GX" switch, it work! Thanks! -- View this message in context: http://boost.2283326.n4.nabble.com/Lexical-cast-and-VC-ExpresEdition-2010-tp... Sent from the Boost - Users mailing list archive at Nabble.com.
participants (4)
-
Christian Henning
-
Claude
-
Igor R
-
Nat Linden