Hi, I’m trying to use Visual Studio to start learning the C++ API. I can not get any sort of output to show up in Maya. I get no errors when building the .mll in Visual studio 2012 update 4 or 2017 and no errors in Maya 2016 or 2016.5 on Windows 7 and 10 same results. All I get is the affirmation that I called the function helloWorld; without error. Even the copy/pasted helloWorldCmd from the devKit gives me the same result. I followed every tutorial I could find on how to set up Visual Studio and it recognizes Maya commands outputs “Build: 1 succeeded.” I’ve looked through every forum I can on the topic and none of their solutions help. I run maya as administrator, redirect cout to cerr: cout.rdbuf(cerr.rdbuf()); use MStreamUtils etc. Here’s an example of trying various outputs to no avail:
#include <maya/MIOStream.h>
#include <maya/MSimple.h>
#include <maya/MGlobal.h>
#include <maya/MStreamUtils.h>
DeclareSimpleCommand(helloWorld, PLUGIN_COMPANY, "4.5");
MStatus helloWorld::doIt(const MArgList&)
{
cout.rdbuf(cerr.rdbuf());
MStreamUtils::stdOutStream().rdbuf();
printf("printf");
cout << "cout" << endl;
std::cout << "std cout";
cerr << "error";
clog << "log";
MStreamUtils::stdErrorStream() << "TEST1 " << "\n";
MStreamUtils::stdOutStream() << "TEST2 " << "\n";
return MS::kSuccess;
}
I’m out of options. Any help?