# Can't get the most basic WSTP demo (addtwo.c) to build and link. Help?

I am trying to use WSTP and started with the addtwo demo. I converted the template file to C using wsprep, then in Visual Studio 2013, added that, the addtwo.c file, the wstp libraries and the header file to the project. It compiled as a console app but would not link, reporting that it could not find main().

The error can be seen here:

What am I doing wrong?

• Note, I'm not a windows guy! But it seems that you don't have configured your project correctly. AddTwo is a simple console application and as it looks, the project you created is not a console application. You can change that in the solution settings somewhere. Can you check that? – halirutan Feb 20 '15 at 21:56
• Please read carefully the instructions here in the WSTP documentation. – halirutan Feb 20 '15 at 22:00
• @halirutan addtwo is in fact not supposed to be a console application on Windows, but the fact that it complains about _main missing suggests that either the wrong source code is being compiled (not the Windows version of addtwo) or it's compiled with the wrong defines. @Michael, also, as I said in an earlier comment, you need to include one version of the library, presumably i4 for Mma 10, not all versions. – Szabolcs Feb 20 '15 at 23:28
• Take a look here too: mathematica.stackexchange.com/q/67787/12 – Szabolcs Feb 20 '15 at 23:29
• @Szabolcs so is this a simple mistake (for someone who is interested and read WSTP documentation)? – Kuba Dec 17 '15 at 22:14