ql 1.6.1 linker error - QuantLib::Error::Error()

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

ql 1.6.1 linker error - QuantLib::Error::Error()

Glenn Williamson

Hi,

 

I am trying to get QL working on Debian, but failing at the last step. I have downloaded the source, built and installed the library (“make”, “make install”) without any errors, but my application that uses the QuantLib library throws up some linker errors related to a single class (QuantLib::Error):

 

build/Debug/GNU-Linux-x86/PricingEngine.o: In function `QuantLib::Observable::notifyObservers()':

/usr/local/include/ql/patterns/observable.hpp:143: undefined reference to `QuantLib::Error::Error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'

 

build/Debug/GNU-Linux-x86/PricingEngine.o: In function `QuantLib::operator+(QuantLib::Array const&, QuantLib::Array const&)':

/usr/local/include/ql/math/array.hpp:499: undefined reference to `QuantLib::Error::Error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'

 

build/Debug/GNU-Linux-x86/PricingEngine.o: In function `QuantLib::DiscretizedOption::reset(unsigned long)':

/usr/local/include/ql/discretizedasset.hpp:222: undefined reference to `QuantLib::Error::Error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'

 

build/Debug/GNU-Linux-x86/PricingEngine.o: In function `QuantLib::Instrument::setupArguments(QuantLib::PricingEngine::arguments*) const':

/usr/local/include/ql/instrument.hpp:145: undefined reference to `QuantLib::Error::Error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'

 

build/Debug/GNU-Linux-x86/PricingEngine.o: In function `QuantLib::Instrument::performCalculations() const':

/usr/local/include/ql/instrument.hpp:164: undefined reference to `QuantLib::Error::Error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'

 

build/Debug/GNU-Linux-x86/PricingEngine.o:/usr/local/include/ql/instrument.hpp:176: more undefined references to `QuantLib::Error::Error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' follow

 

I’m on Debian 8, amd64, compiled both the library and application with g++-5.

 

Does anyone have any ideas?

 

 

Glenn Williamson | Phone: +61 (0)411 843 829 | Email: [hidden email]

 


------------------------------------------------------------------------------

_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

答复: ql 1.6.1 linker error - QuantLib::Error::Error()

cheng li

Hi Glenn,

 

Seems like linking problem. Do you have correctly link the quantlib lib to your application?

 

Regards,

Cheng

 

发件人: Glenn Williamson [mailto:[hidden email]]
发送时间: 201597 7:03
收件人: [hidden email]
主题: [Quantlib-users] ql 1.6.1 linker error - QuantLib::Error::Error()

 

Hi,

 

I am trying to get QL working on Debian, but failing at the last step. I have downloaded the source, built and installed the library (“make”, “make install”) without any errors, but my application that uses the QuantLib library throws up some linker errors related to a single class (QuantLib::Error):

 

build/Debug/GNU-Linux-x86/PricingEngine.o: In function `QuantLib::Observable::notifyObservers()':

/usr/local/include/ql/patterns/observable.hpp:143: undefined reference to `QuantLib::Error::Error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'

 

build/Debug/GNU-Linux-x86/PricingEngine.o: In function `QuantLib::operator+(QuantLib::Array const&, QuantLib::Array const&)':

/usr/local/include/ql/math/array.hpp:499: undefined reference to `QuantLib::Error::Error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'

 

build/Debug/GNU-Linux-x86/PricingEngine.o: In function `QuantLib::DiscretizedOption::reset(unsigned long)':

/usr/local/include/ql/discretizedasset.hpp:222: undefined reference to `QuantLib::Error::Error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'

 

build/Debug/GNU-Linux-x86/PricingEngine.o: In function `QuantLib::Instrument::setupArguments(QuantLib::PricingEngine::arguments*) const':

/usr/local/include/ql/instrument.hpp:145: undefined reference to `QuantLib::Error::Error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'

 

build/Debug/GNU-Linux-x86/PricingEngine.o: In function `QuantLib::Instrument::performCalculations() const':

/usr/local/include/ql/instrument.hpp:164: undefined reference to `QuantLib::Error::Error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'

 

build/Debug/GNU-Linux-x86/PricingEngine.o:/usr/local/include/ql/instrument.hpp:176: more undefined references to `QuantLib::Error::Error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' follow

 

I’m on Debian 8, amd64, compiled both the library and application with g++-5.

 

Does anyone have any ideas?

 

 

Glenn Williamson | Phone: +61 (0)411 843 829 | Email: [hidden email]

 


------------------------------------------------------------------------------

_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: ql 1.6.1 linker error - QuantLib::Error::Error()

Glenn Williamson

>Seems like linking problem. Do you have correctly link the quantlib lib to your application?

 

Yes, it’s certainly a linking problem – and yes, I have “ … -lQuantLib …” on my linker command line. If the linker could not find QuantLib, then it would give many, many, many more errors than just those four J

 

I’ve been looking into it further today, and while I haven’t actually figured it out, I’m thinking that it’s related to me using gcc5 from Debian’s “unstable” branch, apparently there are some big changes between gcc4.9 and gcc5.

 

 

Glenn Williamson | Phone: +61 (0)411 843 829 | Email: [hidden email]


------------------------------------------------------------------------------

_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: ql 1.6.1 linker error - QuantLib::Error::Error()

Peter Caspers-4
I am using gcc 5.1.0, yet on Ubuntu 14.04.1, where it is working just fine.
Peter

On 7 September 2015 at 10:43, Glenn Williamson <[hidden email]> wrote:

>>Seems like linking problem. Do you have correctly link the quantlib lib to
>> your application?
>
>
>
> Yes, it’s certainly a linking problem – and yes, I have “ … -lQuantLib …” on
> my linker command line. If the linker could not find QuantLib, then it would
> give many, many, many more errors than just those four J
>
>
>
> I’ve been looking into it further today, and while I haven’t actually
> figured it out, I’m thinking that it’s related to me using gcc5 from
> Debian’s “unstable” branch, apparently there are some big changes between
> gcc4.9 and gcc5.
>
>
>
>
>
> Glenn Williamson | Phone: +61 (0)411 843 829 | Email: [hidden email]
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>

------------------------------------------------------------------------------
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: ql 1.6.1 linker error - QuantLib::Error::Error()

japari
Rings a bell to some problems I have encountered; still I might be off track but give it a try:
It could be gcc5 is compiling c11 stl now by the look of those error messages. Can you recomp telling gcc to go back to the old days?
Best
Pepe


----- Original Message -----

> I am using gcc 5.1.0, yet on Ubuntu 14.04.1, where it is working just
> fine.
> Peter
>
> On 7 September 2015 at 10:43, Glenn Williamson <[hidden email]>
> wrote:
> >>Seems like linking problem. Do you have correctly link the quantlib
> >>lib to
> >> your application?
> >
> >
> >
> > Yes, it’s certainly a linking problem – and yes, I have “ …
> > -lQuantLib …” on
> > my linker command line. If the linker could not find QuantLib, then
> > it would
> > give many, many, many more errors than just those four J
> >
> >
> >
> > I’ve been looking into it further today, and while I haven’t
> > actually
> > figured it out, I’m thinking that it’s related to me using gcc5
> > from
> > Debian’s “unstable” branch, apparently there are some big changes
> > between
> > gcc4.9 and gcc5.
> >
> >
> >
> >
> >
> > Glenn Williamson | Phone: +61 (0)411 843 829 | Email:
> > [hidden email]
> >
> >
> > ------------------------------------------------------------------------------
> >
> > _______________________________________________
> > QuantLib-users mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/quantlib-users
> >
>
> ------------------------------------------------------------------------------
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>

------------------------------------------------------------------------------
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: ql 1.6.1 linker error - QuantLib::Error::Error()

Peter Caspers-4
hmm, normally I have -std=c++11 enabled, no problems (except these
auto_ptr warnings, which I worked around, but which are not harmful in
any case); still worth a try maybe

On 7 September 2015 at 16:29,  <[hidden email]> wrote:

> Rings a bell to some problems I have encountered; still I might be off track but give it a try:
> It could be gcc5 is compiling c11 stl now by the look of those error messages. Can you recomp telling gcc to go back to the old days?
> Best
> Pepe
>
>
> ----- Original Message -----
>> I am using gcc 5.1.0, yet on Ubuntu 14.04.1, where it is working just
>> fine.
>> Peter
>>
>> On 7 September 2015 at 10:43, Glenn Williamson <[hidden email]>
>> wrote:
>> >>Seems like linking problem. Do you have correctly link the quantlib
>> >>lib to
>> >> your application?
>> >
>> >
>> >
>> > Yes, it’s certainly a linking problem – and yes, I have “ …
>> > -lQuantLib …” on
>> > my linker command line. If the linker could not find QuantLib, then
>> > it would
>> > give many, many, many more errors than just those four J
>> >
>> >
>> >
>> > I’ve been looking into it further today, and while I haven’t
>> > actually
>> > figured it out, I’m thinking that it’s related to me using gcc5
>> > from
>> > Debian’s “unstable” branch, apparently there are some big changes
>> > between
>> > gcc4.9 and gcc5.
>> >
>> >
>> >
>> >
>> >
>> > Glenn Williamson | Phone: +61 (0)411 843 829 | Email:
>> > [hidden email]
>> >
>> >
>> > ------------------------------------------------------------------------------
>> >
>> > _______________________________________________
>> > QuantLib-users mailing list
>> > [hidden email]
>> > https://lists.sourceforge.net/lists/listinfo/quantlib-users
>> >
>>
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> QuantLib-users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>>

------------------------------------------------------------------------------
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: ql 1.6.1 linker error - QuantLib::Error::Error()

Luigi Ballabio
I fired up a Debian unstable virtual machine from a Docker image, and I could compile and link a test program correctly. I'm guessing the guy who answered you on StackOverflow (http://stackoverflow.com/questions/32429149/quantlib-linker-error-quantliberrorerror) might have got it right.

Luigi



On Mon, Sep 7, 2015 at 5:09 PM Peter Caspers <[hidden email]> wrote:
hmm, normally I have -std=c++11 enabled, no problems (except these
auto_ptr warnings, which I worked around, but which are not harmful in
any case); still worth a try maybe

On 7 September 2015 at 16:29,  <[hidden email]> wrote:
> Rings a bell to some problems I have encountered; still I might be off track but give it a try:
> It could be gcc5 is compiling c11 stl now by the look of those error messages. Can you recomp telling gcc to go back to the old days?
> Best
> Pepe
>
>
> ----- Original Message -----
>> I am using gcc 5.1.0, yet on Ubuntu 14.04.1, where it is working just
>> fine.
>> Peter
>>
>> On 7 September 2015 at 10:43, Glenn Williamson <[hidden email]>
>> wrote:
>> >>Seems like linking problem. Do you have correctly link the quantlib
>> >>lib to
>> >> your application?
>> >
>> >
>> >
>> > Yes, it’s certainly a linking problem – and yes, I have “ …
>> > -lQuantLib …” on
>> > my linker command line. If the linker could not find QuantLib, then
>> > it would
>> > give many, many, many more errors than just those four J
>> >
>> >
>> >
>> > I’ve been looking into it further today, and while I haven’t
>> > actually
>> > figured it out, I’m thinking that it’s related to me using gcc5
>> > from
>> > Debian’s “unstable” branch, apparently there are some big changes
>> > between
>> > gcc4.9 and gcc5.
>> >
>> >
>> >
>> >
>> >
>> > Glenn Williamson | Phone: +61 (0)411 843 829 | Email:
>> > [hidden email]
>> >
>> >
>> > ------------------------------------------------------------------------------
>> >
>> > _______________________________________________
>> > QuantLib-users mailing list
>> > [hidden email]
>> > https://lists.sourceforge.net/lists/listinfo/quantlib-users
>> >
>>
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> QuantLib-users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>>

------------------------------------------------------------------------------
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
--

------------------------------------------------------------------------------

_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: ql 1.6.1 linker error - QuantLib::Error::Error()

Glenn Williamson

Yup, I think I’ve got it sorted. Trying to get my platform consistent, and then I think it will work. Thanks!

 

 

Glenn Williamson | Phone: +61 (0)411 843 829 | Email: [hidden email]

 

From: Luigi Ballabio [mailto:[hidden email]]
Sent: Tuesday, 8 September 2015 5:20 PM
To: Peter Caspers <[hidden email]>; [hidden email]
Cc: Glenn Williamson <[hidden email]>; Cheng Li <[hidden email]>; QuantLib users <[hidden email]>
Subject: Re: [Quantlib-users] ql 1.6.1 linker error - QuantLib::Error::Error()

 

I fired up a Debian unstable virtual machine from a Docker image, and I could compile and link a test program correctly. I'm guessing the guy who answered you on StackOverflow (http://stackoverflow.com/questions/32429149/quantlib-linker-error-quantliberrorerror) might have got it right.

 

Luigi

 

 

 

On Mon, Sep 7, 2015 at 5:09 PM Peter Caspers <[hidden email]> wrote:

hmm, normally I have -std=c++11 enabled, no problems (except these
auto_ptr warnings, which I worked around, but which are not harmful in
any case); still worth a try maybe

On 7 September 2015 at 16:29,  <[hidden email]> wrote:
> Rings a bell to some problems I have encountered; still I might be off track but give it a try:
> It could be gcc5 is compiling c11 stl now by the look of those error messages. Can you recomp telling gcc to go back to the old days?
> Best
> Pepe
>
>
> ----- Original Message -----
>> I am using gcc 5.1.0, yet on Ubuntu 14.04.1, where it is working just
>> fine.
>> Peter
>>
>> On 7 September 2015 at 10:43, Glenn Williamson <[hidden email]>
>> wrote:
>> >>Seems like linking problem. Do you have correctly link the quantlib
>> >>lib to
>> >> your application?
>> >
>> >
>> >
>> > Yes, it’s certainly a linking problem – and yes, I have “ …
>> > -lQuantLib …” on
>> > my linker command line. If the linker could not find QuantLib, then
>> > it would
>> > give many, many, many more errors than just those four J
>> >
>> >
>> >
>> > I’ve been looking into it further today, and while I haven’t
>> > actually
>> > figured it out, I’m thinking that it’s related to me using gcc5
>> > from
>> > Debian’s “unstable” branch, apparently there are some big changes
>> > between
>> > gcc4.9 and gcc5.
>> >
>> >
>> >
>> >
>> >
>> > Glenn Williamson | Phone: +61 (0)411 843 829 | Email:
>> > [hidden email]
>> >
>> >
>> > ------------------------------------------------------------------------------
>> >
>> > _______________________________________________
>> > QuantLib-users mailing list
>> > [hidden email]
>> > https://lists.sourceforge.net/lists/listinfo/quantlib-users
>> >
>>
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> QuantLib-users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>>

------------------------------------------------------------------------------
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users

--


------------------------------------------------------------------------------

_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users