Opening a website from C++

Hello

How would I go to open a website (with a browser) in C++?
Linux-only and without system-functions?

Already tried a few things but none worked, thanks a lot.

Thanks for reading,
Niely
what framework are you using?

for qt you can use
http://qt-project.org/doc/qt-5/QProcess.html

for wxwidgets you can use
http://docs.wxwidgets.org/3.0/group__group__funcmacro__procctrl.html
^Thanks a lot! :)
I'm using Qt, but it ain't working.

Could you give an example of how to use it + which headers to include?
^Already tried that, got this error:
error: undefined reference to `QDesktopServices::openUrl(QUrl const&)'
can you show me your code?

i made a quick app and it works for me.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include "mainwindow.h"
#include "ui_mainwindow.h"

#include <QDesktopServices>
#include <QUrl>

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::on_pushButton_clicked()
{
    QDesktopServices::openUrl(QUrl("http://www.nokia.com"));
}
Last edited on
^It only doesn't file this header:
#include <QDesktopServices>
Topic archived. No new replies allowed.