Expected primary-expression before ')'

I am new to C++ and GTKMM. I copied the code from a GTKMM for Beginners PDF and this 'Hello World' program requires a header file and 2 source code file which
are main.cc (the one that should be compiled) and helloworld.cc

Below is the main.cc code

I compile it with g++ running on Kubuntu Linux. But I got this message:

1
2
3
4
main.cc: In function ‘int main(int, char**)’:
main.cc:10:30: error: expected primary-expression before ‘)’ token
     Gtk::Main::run(HelloWorld);
                              ^


Please help! No matter what I do that annoying error message won't get off.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
  #include <gtkmm/main.h>
#include "helloworld.h"

int main (int argc, char *argv[])
{
    Gtk::Main kit(argc, argv);
    
    HelloWorld helloworld;
    //Shows the window and returns when it is closed.
    Gtk::Main::run(helloworld);
    
    return 0;
}


Please excuse my bad English. I don't write in English as often as you people did.
Last edited on
Gtk::Main::run(HelloWorld);

Capital H in the error, but lower case h in the code you showed us. The code you're showing us is not the code that produced the error.
Last edited on
Topic archived. No new replies allowed.