JDL Wahaha
JDL Wahaha

Reputation: 715

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?

Upvotes: 0

Views: 415

Answers (1)

jpw
jpw

Reputation: 44891

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;
}

Upvotes: 1

Related Questions