I tried some things, without success. Apparently curse.h instead conio.h isn't sufficient.

Original lib:
#include <string>
#include <iostream>
#include <stdio.h>
#include <conio.h>

extern "C" __declspec(dllexport) const char * shell(int argc, char ** argv);

std::string result;

const char * shell(int argc, char ** argv) {
FILE* pipe = _popen(argv[0], "r");
if (!pipe) return "ERROR";
char buffer[128];
while(!feof(pipe)) {
if(fgets(buffer, 128, pipe) != NULL)
return result.c_str();
Well, you didn't exactly say what issue you're having. Have you tried popen() instead of _popen()? It's part of stdio.
In response to Nadrew
Converting is the wrong term, what I was wanting is port. I tried it that you said too, but I think that my problem is bigger, a problem that impedes me of test anything in unix server. Check more details: