Can't link when I use from_string() from date_time
-- Sorry if this message is duplicated --
I'm preety new to Boost :-)
When I try to compile / link this little program:
#include
Renan Polo Montebelo wrote:
When I try to compile / link this little program:
[snip sample and error messages]
I can't figure out what's happening, but I'm sure the problem is from_string(). When I don't use it, everything works fine.
The date_time library is not header only, thefore you have to link against the date_time library which you have to build first. See http://www.boost.org/more/getting_started.html#Build_Install for more details. Markus
Hi Markus, In fact, I'm using Automatic Linking on Windows (http://www.boost.org/more/getting_started.html#auto-link). And I'm sure it's linking because I tested it with # define BOOST_LIB_DIAGNOSTIC. And if I don't use boost::gregorian::from_string(), things work fine. Thanks for your reply, Renan. ----- Original Message ----- From: Markus Schöpflin To: boost-users@lists.boost.org Sent: Thursday, October 20, 2005 6:02 AM Subject: Re: [Boost-users] Can't link when I use from_string() from date_time Renan Polo Montebelo wrote:
When I try to compile / link this little program:
[snip sample and error messages]
I can't figure out what's happening, but I'm sure the problem is from_string(). When I don't use it, everything works fine.
The date_time library is not header only, thefore you have to link against the date_time library which you have to build first. See http://www.boost.org/more/getting_started.html#Build_Install for more details. Markus _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users -- No virus found in this incoming message. Checked by AVG Anti-Virus. Version: 7.0.344 / Virus Database: 267.12.4/143 - Release Date: 19/10/2005
Renan Polo Montebelo wrote:
In fact, I'm using Automatic Linking on Windows (http://www.boost.org/more/getting_started.html#auto-link). And I'm sure it's linking because I tested it with # define BOOST_LIB_DIAGNOSTIC.
And if I don't use boost::gregorian::from_string(), things work fine.
Hmm, can you please post a minimal compilable example that exhibits this behaviour, then? Markus
On Fri, 21 Oct 2005 08:56:05 +0200, Markus Schöpflin wrote
Renan Polo Montebelo wrote:
In fact, I'm using Automatic Linking on Windows (http://www.boost.org/more/getting_started.html#auto-link). And I'm sure it's linking because I tested it with # define BOOST_LIB_DIAGNOSTIC.
And if I don't use boost::gregorian::from_string(), things work fine.
Hmm, can you please post a minimal compilable example that exhibits this behaviour, then?
Sorry to be so slow in response, but this behavior is actually explainable. In 1.33, date-time is almost entirely a header library. In fact, the from_string() functions are about the only thing that need things from the library. So more than likely his setup for library linking is incorrect. Note that I'd rewrite from_string to use the new i/o code except that it works on older compilers while the new i/o code doesn't. But in 1.34 I'll likely do that b/c I"m going to drop support for old compilers. I might suggest if you want to work around this you can use streaming instead: std::stringstream ss(...); date d; ss >> d; Jeff
Thanks for all the replies and sorry for my slow response. You're all very kind. After several tests, the problem is clearly the Borland C++ 5.5.1 Compiler. Everything works fine in GCC, even under Cygwin. The problem may be the compiler itself or the Build Jam for the Borland compiler(several compiling errors). Well, in any case I'm switching to GCC definitely. Thank you again, Renan. ----- Original Message ----- From: Jeff Garland To: boost-users@lists.boost.org Sent: Friday, October 21, 2005 2:06 PM Subject: Re: [Boost-users] Can't link when I use from_string() from date_time On Fri, 21 Oct 2005 08:56:05 +0200, Markus Schöpflin wrote
Renan Polo Montebelo wrote:
In fact, I'm using Automatic Linking on Windows (http://www.boost.org/more/getting_started.html#auto-link). And I'm sure it's linking because I tested it with # define BOOST_LIB_DIAGNOSTIC.
And if I don't use boost::gregorian::from_string(), things work fine.
Hmm, can you please post a minimal compilable example that exhibits this behaviour, then?
Sorry to be so slow in response, but this behavior is actually explainable. In 1.33, date-time is almost entirely a header library. In fact, the from_string() functions are about the only thing that need things from the library. So more than likely his setup for library linking is incorrect. Note that I'd rewrite from_string to use the new i/o code except that it works on older compilers while the new i/o code doesn't. But in 1.34 I'll likely do that b/c I"m going to drop support for old compilers. I might suggest if you want to work around this you can use streaming instead: std::stringstream ss(...); date d; ss >> d; Jeff _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users -- No virus found in this incoming message. Checked by AVG Anti-Virus. Version: 7.0.344 / Virus Database: 267.12.4/146 - Release Date: 21/10/2005
On Sun, 23 Oct 2005 16:23:39 -0200, Renan Polo Montebelo wrote
Thanks for all the replies and sorry for my slow response. You're all very kind.
After several tests, the problem is clearly the Borland C++ 5.5.1 Compiler. Everything works fine in GCC, even under Cygwin.
The problem may be the compiler itself or the Build Jam for the Borland compiler(several compiling errors). Well, in any case I'm switching to GCC definitely.
This seems like the right conclusion -- I think somehow I missed you were using this old compiler. The regression tests have all moved on to the Borland 5.6.4 compiler awhile back -- so you may have uncovered a new problem we introduced in 1.33. Even with 5.6.4 the Borland support is only partial -- and the alternative i/o idea I suggested in the last mail definately won't work. Anyway, you can see from http://engineering.meta-comm.com/boost-regression/1_33_0/user/date_time.html that there's alot on 5.6.4 that doesn't work. Switching to gcc is a good approach -- it's basically supports everything except for wide character i/o. Jeff
On Thu, 20 Oct 2005 10:40:58 -0200, Renan Polo Montebelo wrote:
Hi Markus,
In fact, I'm using Automatic Linking on Windows (http://www.boost.org/more/getting_started.html#auto-link). And I'm sure it's linking because I tested it with # define BOOST_LIB_DIAGNOSTIC.
And if I don't use boost::gregorian::from_string(), things work fine.
Thanks for your reply, Renan.
I sent a reply yesterday that never made it to the list, so I apologize if this ends up as a double post... What happens when you try to build without using the Automatic Linking? I believe gcc does not utilize automatic linking. And if memory serves, vc++ requires a path to the lib directory even when auto linking is enabled. I'm not familiar with the borland command syntax, but are you specifying where it should look for the library? Bart
participants (4)
-
Bart
-
Jeff Garland
-
Markus Schöpflin
-
Renan Polo Montebelo