0

Hey there,

I am attempting to open Firefox using C++ on Linux (Ubuntu). However, I get an segmentation fault. What am I doing wrong, and what should I do?

std::cout << system("/usr/bin/firefox") << std::endl;

/usr/bin/firefox works in commandline and when I run this program in debug mode in Netbeans, firefox starts like it should.

I hope to hear from you.

Kind regards,

Schoorsteen

3
Contributors
6
Replies
8
Views
7 Years
Discussion Span
Last Post by daviddoria
0

I'm sure this is not helpful, but as a data point for you this runs fine for me.

#include <iostream>
#include <cstdio>
#include <cstdlib>

int main()
{
  system("/usr/bin/firefox");
 
  return 0;
}

Dave

0

Alright, thank you very much. Strangely enough, running the code with netbeans in execution mode gets me a Segmentation Fault, but if I build it and then run it, it works fine.

Anyone got a clue how this is possible? Or perhaps suggestion what IDE I should use instead?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.