Linking Error for ObjectHandler

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

Linking Error for ObjectHandler

Mark Schuler

Hi all,


I've developed a few QuantLib classes and usually get everything working, but not in the
case of the ObjectHandler. I spent hours trying different settings and setups, but I
still get annoying linkin errors. The original QuantLib never caused any linking/build
errors for me. When building obj handle, I get

>NMAKE : fatal error U1077: "doxygen.exe": R³ckgabe-Code "0x1"
saying doxygen wasn't found. In the docs project.


Here is the next problem. I compile the ObjectHandler_vc8 project, run the example
from this project and everything works fine. However, if I open the ExampleCpp project 
as a single project, I receive linkin errors (I state two of them):

-----------------------------------------------------------------------------------------------------------------------------------
1>example.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""public: static class ObjectHandler::Repository & __cdecl ObjectHandler::Repository::instance(void)" (?instance@Repository@ObjectHandler@@SAAAV12@XZ)" in Funktion ""void __cdecl makeCustomer(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,long const &)" (?makeCustomer@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@0ABJ@Z)".

1>example.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""public: virtual class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > __thiscall AccountExample::CustomerValueObject::getPropertyNamesVector(void)const " (?getPropertyNamesVector@CustomerValueObject@AccountExample@@UBE?AV?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@XZ)".
-----------------------------------------------------------------------------------------------------------------------------------

I then tried to setup my own project, but get the same problems. I have linked against all the libraries stated in the installtion
guide, eg. obj handler +log4cxx. Basically, I have the same setup as the example project, so I get the same errors. I've build
in all possible modes (static/dynamic/debug/release), but nothing solves the problem.

Can anyone help?







Kein Werbe-Blabla - hier klicken!
------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Linking Error for ObjectHandler

Eric Ehlers-2
Hi Mark,

Quoting Mark Schuler <[hidden email]>:

>
>
>
> Hi all,
>
>
>
>
>
> I've developed a few QuantLib classes and usually get everything  
> working, but not in the
>
> case of the ObjectHandler. I spent hours trying different settings  
> and setups, but I
>
> still get annoying linkin errors. The original QuantLib never caused  
>  any linking/build
>
> errors for me. When building obj handle, I get
>
>
>
>> NMAKE : fatal error U1077: "doxygen.exe": R³ckgabe-Code "0x1"
>
> saying doxygen wasn't found. In the docs project.

You need doxygen to rebuild the documentation.  But unless you have  
edited the documentation there is no need to rebuild it, so the  
resolution in this case is not to build that project.

Try building the ExampleCpp from within the ObjectHandler_vc?.sln solution.

> from this project and everything works fine. However, if I open the  
> ExampleCpp project as a single project,

Don't do that :)

Regards,
Eric


------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Linking Error for ObjectHandler

Mark Schuler

Thanks for the reply. Well, actually the building of the documentation is not important
for me.

As I said, the example works fine within ObjectHandler solution, but not if I open the
example as a standalone project. Don't do that - well, I have to setup my own project
where I would need to link in libraries only without including all projects belonging to the Handler.
Does this work? Thanks for your help


> Date: Mon, 22 Jun 2009 20:37:33 +0200
> From: [hidden email]
> To: [hidden email]
> CC: [hidden email]
> Subject: Re: [Quantlib-users] Linking Error for ObjectHandler
>
> Hi Mark,
>
> Quoting Mark Schuler <[hidden email]>:
>
> >
> >
> >
> > Hi all,
> >
> >
> >
> >
> >
> > I've developed a few QuantLib classes and usually get everything
> > working, but not in the
> >
> > case of the ObjectHandler. I spent hours trying different settings
> > and setups, but I
> >
> > still get annoying linkin errors. The original QuantLib never caused
> > any linking/build
> >
> > errors for me. When building obj handle, I get
> >
> >
> >
> >> NMAKE : fatal error U1077: "doxygen.exe": R³ckgabe-Code "0x1"
> >
> > saying doxygen wasn't found. In the docs project.
>
> You need doxygen to rebuild the documentation. But unless you have
> edited the documentation there is no need to rebuild it, so the
> resolution in this case is not to build that project.
>
> Try building the ExampleCpp from within the ObjectHandler_vc?.sln solution.
>
> > from this project and everything works fine. However, if I open the
> > ExampleCpp project as a single project,
>
> Don't do that :)
>
> Regards,
> Eric
>


Die virtuelle Festplatte im Netz - 25 GB für deine Bilder, Musikfiles und Dateien! Jetzt kostenlos sichern!
------------------------------------------------------------------------------

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

Re: Linking Error for ObjectHandler

Eric Ehlers-2
Hi Mark,

> As I said, the example works fine within ObjectHandler solution, but  
>  not if I open the
>
> example as a standalone project. Don't do that - well, I have to  
> setup my own project
>
> where I would need to link in libraries only without including all  
> projects belonging to the Handler.
>
> Does this work? Thanks for your help

In that case you would need to set up your own solution which is a  
clone of the ObjectHandler solution, replacing ExampleCpp with your  
project which clones all of ExampleCpp's prerequisites / dependencies.  
  You could exclude from your solution all redundant projects such as  
documentation.

A quick and dirty way to start would be to add your new project to the  
existing ObjectHandler solution.

Regards,
Eric


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

Re: Linking Error for ObjectHandler

Mark Schuler


Eric thanks a lot again for your advice. I understand the solution
and will proceed as suggested.

However, I'm a bit surprised that this can't be handled by the standard
linking against a lib. If I have a large project and I'd like to use ObjectHandler,
it would be very messy to include all projects to already existing ones. Thats
not what you do with the standard QuantLib either, all you do is include header
+ link against lib. Is this something that will remain in this setup or will it
change in the future?

Thank you





> Date: Wed, 24 Jun 2009 10:14:02 +0200
> From: [hidden email]
> To: [hidden email]
> CC: [hidden email]
> Subject: RE: [Quantlib-users] Linking Error for ObjectHandler
>
> Hi Mark,
>
> > As I said, the example works fine within ObjectHandler solution, but
> > not if I open the
> >
> > example as a standalone project. Don't do that - well, I have to
> > setup my own project
> >
> > where I would need to link in libraries only without including all
> > projects belonging to the Handler.
> >
> > Does this work? Thanks for your help
>
> In that case you would need to set up your own solution which is a
> clone of the ObjectHandler solution, replacing ExampleCpp with your
> project which clones all of ExampleCpp's prerequisites / dependencies.
> You could exclude from your solution all redundant projects such as
> documentation.
>
> A quick and dirty way to start would be to add your new project to the
> existing ObjectHandler solution.
>
> Regards,
> Eric
>


Die virtuelle Festplatte im Netz - 25 GB für deine Bilder, Musikfiles und Dateien! Jetzt kostenlos sichern!
------------------------------------------------------------------------------

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

Re: Linking Error for ObjectHandler

Eric Ehlers-2
In reply to this post by Mark Schuler
Hi Mark,

Quoting Mark Schuler <[hidden email]>:

> Eric thanks a lot again for your advice. I understand the solution
> and will proceed as suggested.
>
> However, I'm a bit surprised that this can't be handled by the standard
> linking against a lib.

It can.  For that approach, you configure your bespoke application as
a single project contained in a single solution.  Your project would
have roughly the same prerequisites as ExampleCpp.  In the project  
settings, ensure that the paths and dependencies are configured to  
pick up all necessary header files and static libraries.

Regards,
Eric



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

Re: Linking Error for ObjectHandler

Mark Schuler


This is what I tried exactly. I tried really really hard. I mean, I got everything working so far, but not this project. I get


1>LINK : warning LNK4098: Standardbibliothek "MSVCRTD" steht in Konflikt mit anderen Bibliotheken; /NODEFAULTLIB:Bibliothek verwenden.
1>QuantlibObjectHandlerTesting.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""public: virtual __thiscall ObjectHandler::Repository::~Repository(void)" (??1Repository@ObjectHandler@@UAE@XZ)" in Funktion "_wmain".
1>QuantlibObjectHandlerTesting.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""public: __thiscall ObjectHandler::Repository::Repository(void)" (??0Repository@ObjectHandler@@QAE@XZ)" in Funktion "_wmain".
1>fatal error LNK1120: 2 nicht aufgelöste externe Verweise.

Non resolved linking. All I do is initializi<a title="Senden" href="javascript:;" onclick="if(window.ComposeContactPicker)return Control.invokeStatic('ComposeContactPicker', 'sendMessagePrep', event, null);" id="SendMessage"> Sendenng a repository:

  ObjectHandler::Repository repository;
 

Is there a project template somewhere which works standalone? Since the Example one doesn't in my
case. I appreaciate your help.






> Date: Wed, 24 Jun 2009 18:42:29 +0200
> From: [hidden email]
> To: [hidden email]
> CC: [hidden email]
> Subject: RE: [Quantlib-users] Linking Error for ObjectHandler
>
> Hi Mark,
>
> Quoting Mark Schuler <[hidden email]>:
>
> > Eric thanks a lot again for your advice. I understand the solution
> > and will proceed as suggested.
> >
> > However, I'm a bit surprised that this can't be handled by the standard
> > linking against a lib.
>
> It can. For that approach, you configure your bespoke application as
> a single project contained in a single solution. Your project would
> have roughly the same prerequisites as ExampleCpp. In the project
> settings, ensure that the paths and dependencies are configured to
> pick up all necessary header files and static libraries.
>
> Regards,
> Eric
>
>


Mehr Sicherheit und Datenschutz - der neue Internet Explorer 8 für MSN Jetzt sofort kostenlos downloaden!
------------------------------------------------------------------------------

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

Re: Linking Error for ObjectHandler

Eric Ehlers-2
Hi Mark,

Quoting Mark Schuler <[hidden email]>:

> This is what I tried exactly. I tried really really hard. I mean, I  
> got everything working so far, but not this project. I get
>
>
> 1>LINK : warning LNK4098: Standardbibliothek "MSVCRTD" steht in  
> Konflikt mit anderen Bibliotheken; /NODEFAULTLIB:Bibliothek verwenden.

When I google on that warning, the first hit takes me to the explanation:

http://msdn.microsoft.com/en-us/library/6wtdswk0(VS.80).aspx

You need to use the same run time library for all of the projects that  
you are linking together.  For more info please see also:

http://quantlib.org/objecthandler/conventions.html

> 1>QuantlibObjectHandlerTesting.obj : error LNK2019: Verweis auf  
> nicht aufgelöstes externes Symbol ""public: virtual __thiscall  
> ObjectHandler::Repository::~Repository(void)"  
> (??1Repository@ObjectHandler@@UAE@XZ)" in Funktion "_wmain".
> 1>QuantlibObjectHandlerTesting.obj : error LNK2019: Verweis auf  
> nicht aufgelöstes externes Symbol ""public: __thiscall  
> ObjectHandler::Repository::Repository(void)"  
> (??0Repository@ObjectHandler@@QAE@XZ)" in Funktion "_wmain".
> 1>fatal error LNK1120: 2 nicht aufgelöste externe Verweise.
>
> Non resolved linking. All I do is initializi
>     Sendenng a repository:
>
>   ObjectHandler::Repository repository;

I'm not sure about this one.  If your main() function includes the  
line of code above, exactly as was done in example.cpp, that should be  
OK.  So it seems that the ObjectHandler static library which contains  
the code for the Repository class is not being linked properly?  Maybe  
the fix above for LNK4098 will also resolve LNK2019 and LNK1120?

> Is there a project template somewhere which works standalone? Since  
> the Example one doesn't in my
> case. I appreaciate your help.

Unfortunately not.  I agree completely, the setup you are attempting  
is the most natural way to use ObjectHandler in a bespoke application,  
so for your case it would be more helpful to put ExampleCpp in a  
separate solution rather than include it in the ObjectHandler  
solution, but that has not been done.

Regards,
Eric


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

Re: Linking Error for ObjectHandler

Mark Schuler


I got rid of the LNK4098 error, the other ones are still there. I give up.
Last question: Do you personally have ever set up a project which
works standalone? This would at least raise some hope, that something
is wrong here. Thank you





> Date: Thu, 25 Jun 2009 12:33:13 +0200
> From: [hidden email]
> To: [hidden email]
> CC: [hidden email]
> Subject: RE: [Quantlib-users] Linking Error for ObjectHandler
>
> Hi Mark,
>
> Quoting Mark Schuler <[hidden email]>:
>
> > This is what I tried exactly. I tried really really hard. I mean, I
> > got everything working so far, but not this project. I get
> >
> >
> > 1>LINK : warning LNK4098: Standardbibliothek "MSVCRTD" steht in
> > Konflikt mit anderen Bibliotheken; /NODEFAULTLIB:Bibliothek verwenden.
>
> When I google on that warning, the first hit takes me to the explanation:
>
> http://msdn.microsoft.com/en-us/library/6wtdswk0(VS.80).aspx
>
> You need to use the same run time library for all of the projects that
> you are linking together. For more info please see also:
>
> http://quantlib.org/objecthandler/conventions.html
>
> > 1>QuantlibObjectHandlerTesting.obj : error LNK2019: Verweis auf
> > nicht aufgelöstes externes Symbol ""public: virtual __thiscall
> > ObjectHandler::Repository::~Repository(void)"
> > (??1Repository@ObjectHandler@@UAE@XZ)" in Funktion "_wmain".
> > 1>QuantlibObjectHandlerTesting.obj : error LNK2019: Verweis auf
> > nicht aufgelöstes externes Symbol ""public: __thiscall
> > ObjectHandler::Repository::Repository(void)"
> > (??0Repository@ObjectHandler@@QAE@XZ)" in Funktion "_wmain".
> > 1>fatal error LNK1120: 2 nicht aufgelöste externe Verweise.
> >
> > Non resolved linking. All I do is initializi
> > Sendenng a repository:
> >
> > ObjectHandler::Repository repository;
>
> I'm not sure about this one. If your main() function includes the
> line of code above, exactly as was done in example.cpp, that should be
> OK. So it seems that the ObjectHandler static library which contains
> the code for the Repository class is not being linked properly? Maybe
> the fix above for LNK4098 will also resolve LNK2019 and LNK1120?
>
> > Is there a project template somewhere which works standalone? Since
> > the Example one doesn't in my
> > case. I appreaciate your help.
>
> Unfortunately not. I agree completely, the setup you are attempting
> is the most natural way to use ObjectHandler in a bespoke application,
> so for your case it would be more helpful to put ExampleCpp in a
> separate solution rather than include it in the ObjectHandler
> solution, but that has not been done.
>
> Regards,
> Eric
>


Kein Werbe-Blabla - hier klicken!
------------------------------------------------------------------------------

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

Re: Linking Error for ObjectHandler

Eric Ehlers-2
Hi Mark,

Quoting Mark Schuler <[hidden email]>:

> I got rid of the LNK4098 error, the other ones are still there. I give up.
> Last question: Do you personally have ever set up a project which
> works standalone? This would at least raise some hope, that something
> is wrong here. Thank you

Yes, many times, though sadly not in a form that I can readily share.  
I think the LNK2019 and LNK1120 errors simply indicate that the linker  
is failing to find the ObjectHandler static library.  Please check to  
make sure that everything is configured correctly.  For example, if  
you are using QuantLib / ObjectHandler version 0.9.7, compiler VC9,  
runtime library Multi-threaded (/MT), configuration "Release (static  
runtime)", then the file to link against is  
ObjectHandler-vc90-mt-s-0_9_7.lib.

The build you are attempting is perfectly straightforward and I'm sure  
it's just a simple question of getting the configuration correct.  
Best of luck.

Regards,
Eric


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