error LNK2019: unresolved external symbol ?

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

error LNK2019: unresolved external symbol ?

Phat Loc
Hi All,

I am new to QuantLib. This is my program

#define NOMINMAX
#include <ql/quantlib.hpp>
#include <iostream>
using namespace std;

int main()
{
        QuantLib::Date Today;

        return 0;
}

When I compile this under Debug. I get the following error? Any clue as to what is wrong? Thanks in advance.

Phat

------ Build started: Project: quantlib_project, Configuration: Debug Win32 ------

Linking...
QuantLib_MTDLL_d.lib(dataformatters.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: char * __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::end(void)" (__imp_?end@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEPADXZ) referenced in function "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl QuantLib::StringFormatter::toLowercase(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?toLowercase@StringFormatter@QuantLib@@SA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV34@@Z)
QuantLib_MTDLL_d.lib(dataformatters.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: char * __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::begin(void)" (__imp_?begin@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEPADXZ) referenced in function "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl QuantLib::StringFormatter::toLowercase(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?toLowercase@StringFormatter@QuantLib@@SA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV34@@Z)
Debug/quantlib_project.exe : fatal error LNK1120: 2 unresolved externals

Build log was saved at "file://c:\Documents and Settings\Phat\My Documents\Visual Studio Projects\quantlib_project\Debug\BuildLog.htm"
quantlib_project - 3 error(s), 0 warning(s)


---------------------- Done ----------------------

    Build: 0 succeeded, 1 failed, 0 skipped



Reply | Threaded
Open this post in threaded view
|

Re: error LNK2019: unresolved external symbol ?

Xavier.Abulker




maybe you could try to add

using namespace QuantLib;

and make sure that the path are correclty setup into the "tools" "options"
of the MS Visual C++

Regards
Xavier



                                                                                                                                 
                    Phat Loc <[hidden email]>                                                                                
                    Sent by:                               To:     <[hidden email]>                        
                    [hidden email]       cc:                                                                    
                    eforge.net                             Subject:     [Quantlib-users] error LNK2019: unresolved external      
                                                            symbol ?                                                              
                                                                                                                                 
                    22/03/2004 04:15                                                                                              
                                                                                                                                 
                                                                                                                                 




Hi All,

I am new to QuantLib. This is my program

#define NOMINMAX
#include <ql/quantlib.hpp>
#include <iostream>
using namespace std;

int main()
{
           QuantLib::Date Today;

           return 0;
}

When I compile this under Debug. I get the following error? Any clue as to
what is wrong? Thanks in advance.

Phat

------ Build started: Project: quantlib_project, Configuration: Debug Win32
------

Linking...
QuantLib_MTDLL_d.lib(dataformatters.obj) : error LNK2019: unresolved
external symbol "__declspec(dllimport) public: char * __thiscall
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> >::end(void)"
(__imp_?end@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEPADXZ)

referenced in function "public: static class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> > __cdecl
QuantLib::StringFormatter::toLowercase(class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> > const &)"
(?toLowercase@StringFormatter@QuantLib@@SA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV34@@Z)

QuantLib_MTDLL_d.lib(dataformatters.obj) : error LNK2019: unresolved
external symbol "__declspec(dllimport) public: char * __thiscall
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> >::begin(void)"
(__imp_?begin@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEPADXZ)

referenced in function "public: static class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> > __cdecl
QuantLib::StringFormatter::toLowercase(class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> > const &)"
(?toLowercase@StringFormatter@QuantLib@@SA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV34@@Z)

Debug/quantlib_project.exe : fatal error LNK1120: 2 unresolved externals

Build log was saved at "file://c:\Documents and Settings\Phat\My
Documents\Visual Studio Projects\quantlib_project\Debug\BuildLog.htm"
quantlib_project - 3 error(s), 0 warning(s)


---------------------- Done ----------------------

    Build: 0 succeeded, 1 failed, 0 skipped



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Quantlib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users





*************************************************************************
Ce message et toutes les pieces jointes (ci-apres le "message") sont
confidentiels et etablis a l'intention exclusive de ses destinataires.
Toute utilisation ou diffusion non autorisee est interdite.
Tout message electronique est susceptible d'alteration.
La FIMAT et ses filiales declinent toute responsabilite au titre de ce
message s'il a ete altere, deforme ou falsifie.
                                          ********
This message and any attachments (the "message") are confidential and
intended solely for the addressees.
Any unauthorised use or dissemination is prohibited.
E-mails are susceptible to alteration.
Neither FIMATnor any of its subsidiaries or affiliates shall be liable for
the message if altered, changed or falsified.



Reply | Threaded
Open this post in threaded view
|

Re: error LNK2019: unresolved external symbol ?

Luigi Ballabio-2
In reply to this post by Phat Loc
On 2004.03.22 04:15, Phat Loc wrote:
> When I compile this under Debug. I get the following error? Any clue
> as to what is wrong? Thanks in advance.
>
> Linking...
> QuantLib_MTDLL_d.lib(dataformatters.obj) : error LNK2019: unresolved
> external symbol

Hi,
        you might want to check that your project is compiled with the  
same settings of the library you're trying to link, namely, Debug  
Multithreaded DLL. You can find the relevant switch under the project  
settings, tab "C/C++", category "Code generation".

Later,
        Luigi


Reply | Threaded
Open this post in threaded view
|

RE: error LNK2019: unresolved external symbol ?

Daniele De Francesco-2
In reply to this post by Phat Loc
You mention that it fails when you compile it in Debug mode.
Do you get the same problem when you compile in Release mode?

You should check if in the project setup for Debug, you are linking into the
right runtime?
In particular, it seems that it's looking for the Multi-threaded Debug DLL
when linking.
If you are compiling your project with, say, Multi-threaded DLL, but the
quantlib library you are using was compiled with Multi-threaded Debug DLL,
then you'll probably get those kind of errors

-Daniele





-----Original Message-----
From: Phat Loc [mailto:[hidden email]]
Sent: Sunday, March 21, 2004 10:15 PM
To: [hidden email]
Subject: [Quantlib-users] error LNK2019: unresolved external symbol ?


Hi All,

I am new to QuantLib. This is my program

#define NOMINMAX
#include <ql/quantlib.hpp>
#include <iostream>
using namespace std;

int main()
{
        QuantLib::Date Today;

        return 0;
}

When I compile this under Debug. I get the following error? Any clue as to
what is wrong? Thanks in advance.

Phat

------ Build started: Project: quantlib_project, Configuration: Debug Win32
------

Linking...
QuantLib_MTDLL_d.lib(dataformatters.obj) : error LNK2019: unresolved
external symbol "__declspec(dllimport) public: char * __thiscall
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> >::end(void)"
(__imp_?end@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE
PADXZ) referenced in function "public: static class
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> > __cdecl QuantLib::StringFormatter::toLowercase(class
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> > const &)"
(?toLowercase@StringFormatter@QuantLib@@SA?AV?$basic_string@DU?$char_traits@
D@std@@V?$allocator@D@2@@std@@ABV34@@Z)
QuantLib_MTDLL_d.lib(dataformatters.obj) : error LNK2019: unresolved
external symbol "__declspec(dllimport) public: char * __thiscall
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> >::begin(void)"
(__imp_?begin@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@Q
AEPADXZ) referenced in function "public: static class
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> > __cdecl QuantLib::StringFormatter::toLowercase(class
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> > const &)"
(?toLowercase@StringFormatter@QuantLib@@SA?AV?$basic_string@DU?$char_traits@
D@std@@V?$allocator@D@2@@std@@ABV34@@Z)
Debug/quantlib_project.exe : fatal error LNK1120: 2 unresolved externals

Build log was saved at "file://c:\Documents and Settings\Phat\My
Documents\Visual Studio Projects\quantlib_project\Debug\BuildLog.htm"
quantlib_project - 3 error(s), 0 warning(s)


---------------------- Done ----------------------

    Build: 0 succeeded, 1 failed, 0 skipped