Auteur Sujet: j'en chie grave en C++ help urgent (static)  (Lu 4930 fois)

Hors ligne a poil laineux

  • Hero Member
  • Messages: 12227
    • Voir le profil
Salut les djeuns

j'ai un gros soucis ... pour diverses raisons, j'ai besoin d'avoir dans une classe une variable map en static, avec les accesseurs en static aussi j'imagine ?

bref, voila ce que je fais :

machin.h

#include
#include

class machin

{
public :
typedef std::map mapMachin;
static mapMachin s_mapMachinInfo;

static string getMapMachin();
static void setMapMachin(string leStringDeNed);
};

machin.cpp

#include "machin.h"
string machin::getMapMachin()
{
return machin::s_mapMachinInfo.first;
}

void machin::getMapMachin(string leStringDeNed)
{
machin::s_mapMachinInfo["truc"]=leStringDeNed;
}


j'ai simplifié mais en gros c'est ca.

et j'ai systématiquement un pb de compile ou on me dit "undefined reference for s_mapMachinInfo" sur les accesseur.

Une idée ? Vite s'il vous plait ...
Never underestimate the bandwidth of a station wagon full of tapes hurtling down the highway / Save a tree, burn a book

Hors ligne a poil laineux

  • Hero Member
  • Messages: 12227
    • Voir le profil
j'en chie grave en C++ help urgent (static)
« Réponse #1 le: 09/07/10 15:22 »
Bon, j'ai trouvé ...  cette putain de variable en static doit etre instanciée a part, faut rajouter

machin::map s_pamMachinInfo; dans le .c ...
Never underestimate the bandwidth of a station wagon full of tapes hurtling down the highway / Save a tree, burn a book

Hors ligne a poil laineux

  • Hero Member
  • Messages: 12227
    • Voir le profil
j'en chie grave en C++ help urgent (static)
« Réponse #2 le: 09/07/10 15:28 »
en fait ca marche toujours pas :/
Never underestimate the bandwidth of a station wagon full of tapes hurtling down the highway / Save a tree, burn a book

Hors ligne a poil laineux

  • Hero Member
  • Messages: 12227
    • Voir le profil
j'en chie grave en C++ help urgent (static)
« Réponse #3 le: 09/07/10 15:39 »
et ca marche pas parce que c'était map machin::s_mapMachinInfo;  qu'il fallait taper.

Never underestimate the bandwidth of a station wagon full of tapes hurtling down the highway / Save a tree, burn a book

Hors ligne dartyduck

  • Hero Member
  • Messages: 24285
  • Sexe: Homme
    • Voir le profil
    • http://www.dayday.fr
j'en chie grave en C++ help urgent (static)
« Réponse #4 le: 09/07/10 15:45 »
ben tu vois, tu t'en es sorti tout seul :o
Sté bien la peine de nous faire chier §§§ [:falzar]
http://www.dayday.fr / Poney lurkeur

Hors ligne Harry Planck

  • Programmateur
  • Hero Member
  • Messages: 2216
  • Sexe: Homme
    • Voir le profil
    • http://goat.cx
j'en chie grave en C++ help urgent (static)
« Réponse #5 le: 09/07/10 17:12 »
Tiens, je me rappelle pourquoi le C++ je trouve ca chiant, maintenant : les messages d'erreur [:love]

Hors ligne mout

  • videur (de verres)
  • Hero Member
  • Messages: 36253
  • Sexe: Homme
    • Voir le profil
    • bricomout
j'en chie grave en C++ help urgent (static)
« Réponse #6 le: 09/07/10 17:18 »
bonjour [:mout]
welcome to the future / la lose / bricomout

Hors ligne Harry Planck

  • Programmateur
  • Hero Member
  • Messages: 2216
  • Sexe: Homme
    • Voir le profil
    • http://goat.cx
j'en chie grave en C++ help urgent (static)
« Réponse #7 le: 09/07/10 17:20 »
Salut alex ! Ca va ?

Hors ligne mout

  • videur (de verres)
  • Hero Member
  • Messages: 36253
  • Sexe: Homme
    • Voir le profil
    • bricomout
j'en chie grave en C++ help urgent (static)
« Réponse #8 le: 09/07/10 17:22 »
Salut alex ! Ca va ?

wat?  [:mout:8]
welcome to the future / la lose / bricomout

Hors ligne a poil laineux

  • Hero Member
  • Messages: 12227
    • Voir le profil
j'en chie grave en C++ help urgent (static)
« Réponse #9 le: 09/07/10 17:31 »
disons que le probleme c'est que c'était pas un map le type, mais un type défini dans la classe machin du coup fallait taper

machin::montypealacon machin::s_mapMachinInfo :o

bon la j'ai un autre probleme mais moins fonctionnel... mais chiant quand meme. J'arrive pas a choper correctement l'identifiant d'un thread lors de sa création et ca me gonfle :o
Never underestimate the bandwidth of a station wagon full of tapes hurtling down the highway / Save a tree, burn a book

Hors ligne Rajesh Koothrappali

  • Condyluriens
  • Hero Member
  • Messages: 19211
  • Nevermind
    • Voir le profil
j'en chie grave en C++ help urgent (static)
« Réponse #10 le: 09/07/10 17:37 »
Les joies du dev :love:
-= It's better to burn out than to fade away =-

Hors ligne pastigo

  • Hero Member
  • Messages: 25363
    • Voir le profil
j'en chie grave en C++ help urgent (static)
« Réponse #11 le: 09/07/10 17:58 »
10 INPUT "Quel est votre nom"; NOM$
 20 PRINT "Bonjour "; NOM$
 30 INPUT "Combien d'étoiles voulez-vous"; NOMBRE
 40 FOR I = 1 TO NOMBRE
 50 ETOILE$ = ETOILE$ + "*"
 55 NEXT I
 60 PRINT ETOILE$
 70 INPUT "Voulez-vous plus d'étoiles"; ETOILE$
 80 IF LEN(ETOILE$) = 0 GOTO 70
 90 ETOILE$ = LEFT$(ETOILE$, 1)
100 IF (ETOILE$ = "O") OR (ETOILE$ = "o") THEN GOTO 30
110 PRINT "Au revoir ";
120 FOR I = 1 TO 200
130 PRINT NOM$; " ";
140 NEXT I
150 PRINT
Un pigeon, c'est plus con qu'un dauphin, d'accord... mais Aa vole / oui / condylure misAreux

Hors ligne a poil laineux

  • Hero Member
  • Messages: 12227
    • Voir le profil
j'en chie grave en C++ help urgent (static)
« Réponse #12 le: 09/07/10 18:01 »
je préfère 10x les joies de faire tout le cycle en V que l'horreur de se taper de la correction/passage de test en mode cerveau éteint :D

La je fais tout, depuis la prise en compte des exigences jusqu'a la recette :love:
Never underestimate the bandwidth of a station wagon full of tapes hurtling down the highway / Save a tree, burn a book

Hors ligne 0rken

  • gros
  • Hero Member
  • Messages: 15415
  • Sexe: Homme
    • Voir le profil
    • http://www.blakk-olifant.fr
j'en chie grave en C++ help urgent (static)
« Réponse #13 le: 09/07/10 19:42 »
moi je fais du java
les grosses / Gros dAgueulasseA

Hors ligne Harry Planck

  • Programmateur
  • Hero Member
  • Messages: 2216
  • Sexe: Homme
    • Voir le profil
    • http://goat.cx
j'en chie grave en C++ help urgent (static)
« Réponse #14 le: 10/07/10 00:20 »
je préfère 10x les joies de faire tout le cycle en V que l'horreur de se taper de la correction/passage de test en mode cerveau éteint :D

La je fais tout, depuis la prise en compte des exigences jusqu'a la recette :love:

actuellement, je retape un scheduler de grille, pour qu'il envoie des jobs par paquets plutôt qu'à l'unité, histoire de ne pas surcharger les schedulers de cluster et augmenter l'efficacité globale. Base déja faite, mélange perl/ruby, carte blanche, et "si t'as le temps, occuppe toi de faire un sched un peu intelligent, tant qu'a faire" [:huit]

Hors ligne Bitman

  • Master of Condylures
  • Administrator
  • Hero Member
  • *****
  • Messages: 85808
  • Sexe: Homme
  • Show me Uranus
    • Voir le profil
    • anal teen exploited
j'en chie grave en C++ help urgent (static)
« Réponse #15 le: 10/07/10 00:30 »
10 INPUT "Quel est votre nom"; NOM$
 20 PRINT "Bonjour "; NOM$
 30 INPUT "Combien d'étoiles voulez-vous"; NOMBRE
 40 FOR I = 1 TO NOMBRE
 50 ETOILE$ = ETOILE$ + "*"
 55 NEXT I
 60 PRINT ETOILE$
 70 INPUT "Voulez-vous plus d'étoiles"; ETOILE$
 80 IF LEN(ETOILE$) = 0 GOTO 70
 90 ETOILE$ = LEFT$(ETOILE$, 1)
100 IF (ETOILE$ = "O") OR (ETOILE$ = "o") THEN GOTO 30
110 PRINT "Au revoir ";
120 FOR I = 1 TO 200
130 PRINT NOM$; " ";
140 NEXT I
150 PRINT

je faisais ca sur mon MO5 aussi, a l'epoque je pensais qu'en le perfectionnant je pourrais fabriquer une intelligence artificielle !

on est cons a 11 ans (comme maniou :o)
Hard times create strong men. Strong men create good times. Good times create weak men. And, weak men create hard times.

Hors ligne 0rken

  • gros
  • Hero Member
  • Messages: 15415
  • Sexe: Homme
    • Voir le profil
    • http://www.blakk-olifant.fr
j'en chie grave en C++ help urgent (static)
« Réponse #16 le: 10/07/10 00:45 »
moi je regardait whizkid, et je pensais pouvoir me connecter à la banque de mes parents
les grosses / Gros dAgueulasseA

Hors ligne Thor941

  • Hero Member
  • Messages: 42597
    • Voir le profil
j'en chie grave en C++ help urgent (static)
« Réponse #17 le: 10/07/10 07:58 »

je faisais ca sur mon MO5 aussi, a l'epoque je pensais qu'en le perfectionnant je pourrais fabriquer une intelligence artificielle !

on est cons a 11 ans (comme maniou :o)

ok zatane
yo soy culA / Requin brown recluse

Hors ligne pastigo

  • Hero Member
  • Messages: 25363
    • Voir le profil
j'en chie grave en C++ help urgent (static)
« Réponse #18 le: 10/07/10 12:07 »

je faisais ca sur mon MO5 aussi, a l'epoque je pensais qu'en le perfectionnant je pourrais fabriquer une intelligence artificielle !

on est cons a 11 ans (comme maniou :o)

bof, moi j'avais atteint le degré ultime que j'envisageai en réussissant meme à copier une disquette QUI MARCHE de afterburner.
Un pigeon, c'est plus con qu'un dauphin, d'accord... mais Aa vole / oui / condylure misAreux

Hors ligne Rajesh Koothrappali

  • Condyluriens
  • Hero Member
  • Messages: 19211
  • Nevermind
    • Voir le profil
j'en chie grave en C++ help urgent (static)
« Réponse #19 le: 10/07/10 12:58 »
je préfère 10x les joies de faire tout le cycle en V que l'horreur de se taper de la correction/passage de test en mode cerveau éteint :D

La je fais tout, depuis la prise en compte des exigences jusqu'a la recette :love:


:/
-= It's better to burn out than to fade away =-

Hors ligne a poil laineux

  • Hero Member
  • Messages: 12227
    • Voir le profil
j'en chie grave en C++ help urgent (static)
« Réponse #20 le: 12/07/10 12:45 »
ben disons qu'il a été accepté que ce n'est pas un cycle en V mais plutot un cycle itératif, donc ca va.
Never underestimate the bandwidth of a station wagon full of tapes hurtling down the highway / Save a tree, burn a book