Précédent   Forum du club des développeurs et IT Pro > Général Développement > Programmation système > Linux > GTK > GTK+
GTK+ Forum d'entraide sur le développement avec GTK+. Avant de poster -> FAQ GTK+
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse
 
Outils de la discussion
Publicité
'
Vieux 25/02/2013, 15h40   #1
Zephou
Invité de passage
 
Inscription : janvier 2013
Messages : 4
Détails du profil
Informations personnelles :
Localisation : France, Pas de Calais (Nord Pas de Calais)

Informations forums :
Inscription : janvier 2013
Messages : 4
Points : 2
Points : 2
Par défaut Problème compilation gtkmm sous mac

Bonjour,

Ayant besoin de Gtkmm pour un TP en C++, je n'arrive même pas à compiler ce code de test:

Citation:
#include <gtkmm.h>

using namespace Gtk;

int main (int argc, int *argv[]) {
Main kit(argc, argv);
Window window;
kit.run(window);
return EXIT_SUCCESS;
}
J'ai installé gtkmm via macport, avec la commande:

Citation:
sudo port install gtkmm
L'installation s'est déroulée sans aucun problème, et ensuite pour compiler j'utilise la commande:

Citation:
g++ testgtkmm.cpp `pkg-config gtkmm-2.4 --cflags --libs`
Mais j'obtiens ces erreurs:

Citation:
testgtkmm.cpp: In function ‘int main(int, int**)’:
testgtkmm.cpp:6: error: no matching function for call to ‘Gtk::Main::Main(int&, int**&)’
/opt/local/include/gtkmm-2.4/gtkmm/main.h:274: note: candidates are: Gtk::Main::Main()
/opt/local/include/gtkmm-2.4/gtkmm/main.h:163: note: Gtk::Main::Main(int&, char**&, bool)
/opt/local/include/gtkmm-2.4/gtkmm/main.h:160: note: Gtk::Main::Main(int*, char***, bool)
/opt/local/include/gtkmm-2.4/gtkmm/main.h:150: note: Gtk::Main::Main(int&, char**&, Glib::OptionContext&)
/opt/local/include/gtkmm-2.4/gtkmm/main.h:126: note: Gtk::Main::Main(const Gtk::Main&)
Auriez-vous une solution à me proposer? Merci!
Zephou est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 25/02/2013, 17h44   #2
Le Farfadet Spatial
Membre éclairé
 
Avatar de Le Farfadet Spatial
 
Inscription : avril 2008
Messages : 135
Détails du profil
Informations forums :
Inscription : avril 2008
Messages : 135
Points : 341
Points : 341
Salut à tous !

Il y a une erreur dans ton code de test : en C++ standard, la fonction « main » prend en arguments un entier (nombre d’arguments) et un tableau de chaînes de caractères de type C (valeurs des arguments). Que donne la compilation du code suivant :

Code :
1
2
3
4
5
6
7
8
#include <gtkmm.h>
 
int main (int argc, char **argv) {
  Gtk::Main kit(argc, argv);
  Gtk::Window window;
  kit.run(window);
  return 0;
}
À bientôt.

Le Farfadet Spatial
Le Farfadet Spatial est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 25/02/2013, 19h20   #3
Zephou
Invité de passage
 
Inscription : janvier 2013
Messages : 4
Détails du profil
Informations personnelles :
Localisation : France, Pas de Calais (Nord Pas de Calais)

Informations forums :
Inscription : janvier 2013
Messages : 4
Points : 2
Points : 2
Ha effectivement ça va nettement mieux maintenant! Merci!
Zephou est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 25/02/2013, 23h17   #4
Le Farfadet Spatial
Membre éclairé
 
Avatar de Le Farfadet Spatial
 
Inscription : avril 2008
Messages : 135
Détails du profil
Informations forums :
Inscription : avril 2008
Messages : 135
Points : 341
Points : 341
Salut à tous !

Parfait. Pense à passer le sujet en résolu.

À bientôt.

Le Farfadet Spatial
Le Farfadet Spatial est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Cette discussion est résolue.
Outils de la discussion

Navigation rapide


Fuseau horaire GMT +2. Il est actuellement 09h36.


 
 
 
 
Partenaires

Hébergement Web