I am calling a C++compiler from VS2017 . But getting an error.
Needs["CCompilerDriver`"]
CCompilers[]
hello = CreateExecutable["
// Hello100.cpp : Defines the entry point for the console \
application.
//
#include " stdafx.h "
#include <iostream>
// i/o example
// stringstreams
#include <string>
#include <sstream>
using namespace std;
int main()
{
string mystr;
float price = 0;
int quantity = 0;
int next;
cout << " Enter price : ";
getline(cin, mystr);
stringstream(mystr) >> price;
cout << " Enter quantity : ";
getline(cin, mystr);
stringstream(mystr) >> quantity;
cout << " Total price : " << price * quantity << endl;
cin >> next;
return 0;
}
", "hellomyfirst"];
Import["!" <> QuoteFile[hellomyfirst], Text]
I am getting the following error
In[32]:= Import["!" <> QuoteFile[hellomyfirst], Text]
During evaluation of In[32]:= StringJoin::string: String expected at position 2 in !<>QuoteFile[hellomyfirst].
During evaluation of In[32]:= Import::chtype: First argument !<>QuoteFile[hellomyfirst] is not a valid file, directory, or URL specification.
Out[32]= $Failed
Why am not getting the output ? The code compiled in Visual Studio ok.
1st UPDATE
The Visual Studio 2017 C++ SDK option will work only under Windows 10. I was running this under windows 8.1. I updated to W10 and got it to work.
Attachments: