Menu

error LNK2019: unresolved external symbol

Help
2015-12-01
2016-01-25
  • Dariusz Pietrzak

    Hi,
    I am quite new to C++ (coming from .NET environment) and I am trying to use FastFormat in VS C++ (Express 2012 for Windows Desktop).
    I did the following steps following what I have found in the FAQ:
    1.
    download and unzip FastFormat and STLSoft to:
    D:\3pty\cpp_fast_format\fastformat-0.7.1
    D:\3pty\stlsoft-1.9.124
    2.
    open VS2012 x64 Cross Tools Command Prompt
    change directory to D:\3pty\cpp_fast_format\fastformat-0.7.1\build\vc12
    3.
    define environment variables:
    SET STLSOFT=D:\3pty\stlsoft-1.9.124
    SET FASTFORMAT_ROOT=D:\3pty\cpp_fast_format\fastformat-0.7.1
    4.
    run the following command:
    nmake build.libs.core
    5.
    in Configuration Properties --> C/C++ --> General
    define Additional Include Directories: D:\3pty\cpp_fast_format\fastformat-0.7.1\include; D:\3pty\stlsoft-1.9.124\include
    6.
    in Configuration Properties --> Linker --> General
    define Additional Include Directories: D:\3pty\cpp_fast_format\fastformat-0.7.1\lib
    7.
    in Configuration Properties --> General
    change Character Set from Use Unicode Character Set to Use Multi-Byte Character Set

    Now here is my "program":

    #include<iostream>
    #include <string>
    #include <fastformat fastformat.hpp=""></fastformat></string></iostream>

    #define FASTFORMAT_NO_VERSION_NAG

    using namespace std;

    int main()
    {

       std::string             sink;
       char const*             arg0    =   "arg0";
    
       sink.erase();
       fastformat::fmt(sink, "A c-style string: {0}", arg0);
    
       cout<<"\npress ENTER...";cin.get();
       return 0;
    

    }

    now, when trying to build it I get the following error messages:

    main.obj : error LNK2019: unresolved external symbol _fastformat_init referenced in function "public: __thiscall fastformat::fastformat_initialiser::fastformat_initialiser(void)" (??0fastformat_initialiser@fastformat@@QAE@XZ)
    1>main.obj : error LNK2019: unresolved external symbol _fastformat_uninit referenced in function "public: __thiscall fastformat::fastformat_initialiser::~fastformat_initialiser(void)" (??1fastformat_initialiser@fastformat@@QAE@XZ)
    etc etc...

    Could not find any more suggestion in FAQ. I would appreciate any suggestions! Thanks!

    Dariusz

     
  • Dariusz Pietrzak

    just one more comment:

    when building using command: nmake build
    I receive error:
    D:\3pty\cpp_fast_format\fastformat-0.7.1\include\fastformat/sinks/CComBSTR.hpp(79) : fatal error C1083: Cannot open include file: 'atlbase.h': No such file or directory
    NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\BIN\cl.EXE"' : return code '0x2'

    The problem is with atlbase.h which (as far as I found) does not come with vs c++ Express edition.

    Not sure if this is also a reason for the error I receive when trying to build my code.

    /dariusz

     
  • Srinivas Prabhu

    Srinivas Prabhu - 2016-01-25

    I am facing the same issue. Did you find a solution?

     

Log in to post a comment.

MongoDB Logo MongoDB