简体   繁体   中英

How to use STLSoft library on Visual Studio 2013?

I was following the installation step on this post: http://binglongx.wordpress.com/2010/08/30/stlsoft-installation/

I set it up as follows (because I don't have a D-drive):

  1. Extract the file to C:\\
  2. Right click project -> properties -> Debug -> Environment: PATH=%PATH%;C:\\stlsoft-1.9.117;
  3. properties -> VC++ Directories -> Include Directories: C:\\stlsoft-1.9.117\\include

However, when I run the sample code in the post, it outputs: error LNK1561: entry point must be defined

Might anyone know where I went wrong?

The application needs a main function as its entry point and the sample in the blog post is incomplete. Try this:

#include <stlsoft/conversion/integer_to_string.hpp>
#include <string>
#include <iostream>

std::string int2string(int i)    
{
    char buf[30];    // 29 digits, enough for longest integer, even 64-bit
    const char* s = stlsoft::integer_to_string(buf, i);
    return std::string(s);
}

int main (int argc, char* argv[]{
    std::cout << int2string(5) << std::endl;
    return 0;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM