I tried to create a simple IDE. Then when I tried to pass the command :
Code:
void compile_clicked( GtkWidget *w, TextEditor *editor )
{
char *output;
GError **error = NULL;
GtkTextBuffer *buffer;
string command_line = "g++ main.cpp -o main";
cout << command_line << endl;
cin.ignore( 80, '\n' );
g_spawn_command_line_sync( command_line.c_str(),
&output,
NULL,
NULL,
error );
buffer = gtk_text_view_get_buffer( GTK_TEXT_VIEW( editor->error_textview ) );
gtk_text_buffer_set_text( buffer, output, -1 );
}
It compiled fine, but after I click the compile_clicked button, my app was completely freeze :( ! I don't know why since which other command line such as "cat" or "find", it works really fine. Could anyone give me a hint where I did wrong ? Thanks in advance !