Date_Time undefined reference
Hi, I am having a problem compiling the following example #include "boost/date_time/gregorian/gregorian.hpp" #include "boost/date_time/date_parsing.hpp" #include <iostream> #include <string> int main() { using namespace boost::gregorian; std::string s("2002-10-15"); date d(from_string(s)); std::cout << to_simple_string(d) << std::endl; return 0; }; The linker is complaining about an undefined reference to boost::gregorian::greg_month::as_short_string() const and boost::gregorian::greg_month::as_long_string() const using g++ 3.0.4 g++ test.cpp -o test -DDATE_TIME_INLINE Seems the problem is in the call to to_simple_string(d) Is there something obvious I'm missing here. Thanks David.
David wrote:
The linker is complaining about an undefined reference to boost::gregorian::greg_month::as_short_string() const and boost::gregorian::greg_month::as_long_string() const
using g++ 3.0.4 g++ test.cpp -o test -DDATE_TIME_INLINE
These get built into the libboost_date_time.a which needs to be included in your link line. So add something like: -L BOOST_TOP/libs/date_time/build/bin/libboost_date_time.a/gcc/debug/runtime-link-dynamic -lboost_date_time Feel free to move the library somewhere with a shorter path :-) If you haven't built the library you will need to go /libs/date_time/build and run bjam to produce the library. Just microseconds after 1.29.0 was released I realized that I forgot to update the top-level boost Jamfile.... Jeff
On Tuesday 15 October 2002 11:40 am, Jeff Garland wrote:
If you haven't built the library you will need to go /libs/date_time/build and run bjam to produce the library. Just microseconds after 1.29.0 was released I realized that I forgot to update the top-level boost Jamfile....
Is there any way to disable the tests when building the library? Thanks, -- Alkis
Spot on.
Thanks for the help Jeff.
- David
"Jeff Garland"
David wrote:
The linker is complaining about an undefined reference to boost::gregorian::greg_month::as_short_string() const and boost::gregorian::greg_month::as_long_string() const
using g++ 3.0.4 g++ test.cpp -o test -DDATE_TIME_INLINE
These get built into the libboost_date_time.a which needs to be included in your link line. So add something like:
-L BOOST_TOP/libs/date_time/build/bin/libboost_date_time.a/gcc/debug/runtime-li nk-dynamic -lboost_date_time
Feel free to move the library somewhere with a shorter path :-)
If you haven't built the library you will need to go /libs/date_time/build and run bjam to produce the library. Just microseconds after 1.29.0 was released I realized that I forgot to update the top-level boost Jamfile....
Jeff
Ok, here goes a newbie one. I've already built boost 1.29.0, and I've also managed to build boost::date_time (libboost_date_time) using msvc6.0. I've added the .lib file to my project, included it in my Project>>Settings>>Object/library modules list and I've got the header path ok too. Why do I keep receiving the following Link Error message? LNK2001: unresolved external symbol "public: static unsigned long __cdecl boost::date_time::gregorian_calendar_base<... I really can't find a reason, besides the fact that this is supposed to be a runtime link library. Marcio Araujo -----Original Message----- From: Jeff Garland [mailto:jeff@crystalclearsoftware.com] Sent: Tuesday, October 15, 2002 3:40 PM To: Boost-Users@yahoogroups.com Subject: RE: [Boost-Users] Date_Time undefined reference David wrote:
The linker is complaining about an undefined reference to boost::gregorian::greg_month::as_short_string() const and boost::gregorian::greg_month::as_long_string() const
using g++ 3.0.4 g++ test.cpp -o test -DDATE_TIME_INLINE
These get built into the libboost_date_time.a which needs to be included in your link line. So add something like: -L BOOST_TOP/libs/date_time/build/bin/libboost_date_time.a/gcc/debug/runtime-li nk-dynamic -lboost_date_time Feel free to move the library somewhere with a shorter path :-) If you haven't built the library you will need to go /libs/date_time/build and run bjam to produce the library. Just microseconds after 1.29.0 was released I realized that I forgot to update the top-level boost Jamfile.... Jeff Info: http://www.boost.org Wiki: http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl Unsubscribe: mailto:boost-users-unsubscribe@yahoogroups.com Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ Esta mensagem foi verificada pelo E-mail Protegido Terra. Scan engine: VirusScan / Atualizado em 09/10/2002 / Versão: 1.3.13 Proteja o seu e-mail Terra: http://www.emailprotegido.terra.com.br/
Ok, here goes a newbie one.
I've already built boost 1.29.0, and I've also managed to build boost::date_time (libboost_date_time) using msvc6.0. I've added the .lib file to my project, included it in my Project>>Settings>>Object/library modules list and I've got the header path ok too.
Why do I keep receiving the following Link Error message?
LNK2001: unresolved external symbol "public: static unsigned long __cdecl boost::date_time::gregorian_calendar_base<...
I really can't find a reason, besides the fact that this is supposed to be a runtime link library.
Make sure you define DATE_TIME_INLINE in your client project setting. Sorry, I broke this switch so it turns out clients always have to define this macro which is a headache. I'm planning on fixing this in 1.29.1. Jeff
Thanks Jeff!! Marcio Del'Valle -----Original Message----- From: Jeff Garland [mailto:jeff@crystalclearsoftware.com] Sent: Friday, October 25, 2002 8:46 PM To: Boost-Users@yahoogroups.com Subject: RE: [Boost-Users] Date_Time undefined reference
Ok, here goes a newbie one.
I've already built boost 1.29.0, and I've also managed to build boost::date_time (libboost_date_time) using msvc6.0. I've added the .lib file to my project, included it in my Project>>Settings>>Object/library modules list and I've got the header path ok too.
Why do I keep receiving the following Link Error message?
LNK2001: unresolved external symbol "public: static unsigned long __cdecl boost::date_time::gregorian_calendar_base<...
I really can't find a reason, besides the fact that this is supposed to be a runtime link library.
Make sure you define DATE_TIME_INLINE in your client project setting. Sorry, I broke this switch so it turns out clients always have to define this macro which is a headache. I'm planning on fixing this in 1.29.1. Jeff Info: http://www.boost.org Wiki: http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl Unsubscribe: mailto:boost-users-unsubscribe@yahoogroups.com Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ Esta mensagem foi verificada pelo E-mail Protegido Terra. Scan engine: VirusScan / Atualizado em 23/10/2002 / Versão: 1.3.13 Proteja o seu e-mail Terra: http://www.emailprotegido.terra.com.br/
Hi , I'm trying to move from boost 1.26 to boost 1.28 and i want to change the number of arguments of the functions i can connect to python. Therefore i modified the gen_all.py in libs/python/src (as i did for the 1.26 version) but i get the following error : python gen_all.py Traceback (most recent call last): File "gen_all.py", line 24, in ? print gen_all(args) File "gen_all.py", line 9, in gen_all open('callback.hpp', 'w').write(gen_callback(args)) File "gen_callback.py", line 5, in gen_callback return ( File "gen_function.py", line 237, in gen_functions result = result + apply(gen_function, (template, x) + args, keywords) File "gen_function.py", line 216, in gen_function result = result + expand(_gen_common_key(key, n, args, fill)) File "gen_function.py", line 170, in <lambda> expand = (lambda s, n = n: NameError: global name 'args' is not defined Has somebody done a patch for this problem ? Besides i'd like if there is a maximum number of arguments for the function i want to connect to python with boost 1.29. (i can't move to boost 1.29 now but i plan to do it later). Thank you everybody
"Xavier WARIN(Compte LOCAL) - I23"
Hi ,
I'm trying to move from boost 1.26 to boost 1.28 and i want to change the number of arguments of the functions i can connect to python. Therefore i modified the gen_all.py in libs/python/src (as i did for the 1.26 version) but i get the following error :
python gen_all.py
Traceback (most recent call last): File "gen_all.py", line 24, in ? print gen_all(args) File "gen_all.py", line 9, in gen_all open('callback.hpp', 'w').write(gen_callback(args)) File "gen_callback.py", line 5, in gen_callback return ( File "gen_function.py", line 237, in gen_functions result = result + apply(gen_function, (template, x) + args, keywords) File "gen_function.py", line 216, in gen_function result = result + expand(_gen_common_key(key, n, args, fill)) File "gen_function.py", line 170, in <lambda> expand = (lambda s, n = n: NameError: global name 'args' is not defined
Has somebody done a patch for this problem ?
I don't think so. You might try to see if it's fixed in this unsupported archive of Boost.Python v1: http://www.boost.org/libs/python/build/python_v1.zip
Besides i'd like if there is a maximum number of arguments for the function i want to connect to python with boost 1.29. (i can't move to boost 1.29 now but i plan to do it later).
It's configurable; see http://www.boost.org/libs/python/doc/v2/configuration.html HTH, -- David Abrahams dave@boost-consulting.com * http://www.boost-consulting.com Building C/C++ Extensions for Python: Dec 9-11, Austin, TX http://www.enthought.com/training/building_extensions.html
participants (6)
-
Alkis Evlogimenos
-
David Abrahams
-
David Clark
-
Jeff Garland
-
Marcio Del'Valle
-
Xavier WARIN(Compte LOCAL) - I23