Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
4592 connectés 

  FORUM HardWare.fr
  Programmation
  C++

  Qui a deja utilisé les lib Boost ?

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

Qui a deja utilisé les lib Boost ?

n°381508
djmanu22
Posté le 04-05-2003 à 01:01:20  profilanswer
 

Salut,
pour l'ecole je dois faire l'etude des librairies boost (www.boost.org). Est ce que qq s'en ai deja servi parsque j'ai qq probleme pour les threads qui ne fonctionnent ni sous win ni sous linux et d'autres probs.
Fau-il faire qqchose de special pr les threads ??
Merci d'avance  
Manu

mood
Publicité
Posté le 04-05-2003 à 01:01:20  profilanswer
 

n°381514
verdoux
And I'm still waiting
Posté le 04-05-2003 à 01:10:50  profilanswer
 

Etant donné que ces libs sont largement utilisées, je pense que tu dois faire un truc de travers.

n°381555
Taz
bisounours-codeur
Posté le 04-05-2003 à 07:32:56  profilanswer
 

fonctionne tres bien chez moi

n°381609
djmanu22
Posté le 04-05-2003 à 12:23:46  profilanswer
 

Je ne pense pas vu que je reprend les exemples des threads du site web....
Il n'y a rien a faire de special pr faire fonctionner les threads ?

n°381611
Taz
bisounours-codeur
Posté le 04-05-2003 à 12:25:43  profilanswer
 

tu as essayé de prendre les sources et de les compiler toi meme?
 
comment se passe la compialtion des exemple? l'exécution?

n°381698
djmanu22
Posté le 04-05-2003 à 14:16:30  profilanswer
 

Non je n'ai pas encore essayer de les compiler, voici les erreurs que j'ai:
Sous linux:
root@manu manu # g++ -I /home/manu/boost_1_30_0 thread.cpp
/tmp/ccWAbAOa.o(.text+0x76): In function `main':
: undefined reference to `boost::thread::thread[in-charge](boost::function0<void, std::allocator<boost::function_base> > const&)'
/tmp/ccWAbAOa.o(.text+0xad): In function `main':
: undefined reference to `boost::thread::join()'
/tmp/ccWAbAOa.o(.text+0xc0): In function `main':
: undefined reference to `boost::thread::~thread [in-charge]()'
/tmp/ccWAbAOa.o(.text+0xd9): In function `main':
: undefined reference to `boost::thread::~thread [in-charge]()'
/tmp/ccWAbAOa.o(.gnu.linkonce.t._ZN12thread_alarmclEv+0x15): In function `thread_alarm::operator()()':
: undefined reference to `boost::xtime_get(boost::xtime*, int)'
/tmp/ccWAbAOa.o(.gnu.linkonce.t._ZN12thread_alarmclEv+0x34): In function `thread_alarm::operator()()':
: undefined reference to `boost::thread::sleep(boost::xtime const&)'
collect2: ld returned 1 exit status
 
 
SOus win avec VS.NET:
boost2 error LNK2001: symbole externe non résolu "int __cdecl boost::xtime_get(struct boost::xtime *,int)" (?xtime_get@boost@@$$FYAHPAUxtime@1@H@Z)
boost2 error LNK2001: symbole externe non résolu "public: __thiscall boost::thread::~thread(void)" (??1thread@boost@@$$FQAE@XZ)
boost2 error LNK2001: symbole externe non résolu "public: __thiscall boost::thread::~thread(void)" (??1thread@boost@@QAE@XZ)
boost2 error LNK2001: symbole externe non résolu "public: static void __cdecl boost::thread::sleep(struct boost::xtime const &)" (?sleep@thread@boost@@$$FSAXABUxtime@2@@Z)
boost2 error LNK2001: symbole externe non résolu "public: __thiscall boost::thread::thread(class boost::function0<void,int> const &)" (??0thread@boost@@$$FQAE@ABV?$function0@XH@1@@Z)
boost2 error LNK2001: symbole externe non résolu "public: void __thiscall boost::thread::join(void)" (?join@thread@boost@@$$FQAEXXZ)
boost2 fatal error LNK1120: 6 externes non résolus
 
 
 
Apparement il s'agit du meme prob dans les 2 cas pourtant il trouve bien les fichier header....


Message édité par djmanu22 le 04-05-2003 à 14:17:12
n°381729
Taz
bisounours-codeur
Posté le 04-05-2003 à 15:21:26  profilanswer
 

lit la doc, tout est expliqué pour la compilation, ton problème étant que tu ne fais pas le link avec la bibliothèque

n°381746
djmanu22
Posté le 04-05-2003 à 15:42:45  profilanswer
 

Oki j'ai recompiler les lib pour les threads.
Maintenant, comment les linker avec mon prog (quel paramètre à passer à gcc et vc7 ?)?

n°381751
Taz
bisounours-codeur
Posté le 04-05-2003 à 15:50:31  profilanswer
 

RTFM²

n°382621
djmanu22
Posté le 05-05-2003 à 14:01:38  profilanswer
 

J'ai tout recompiler avec les ports gentoo mais j'ai tjs ce probleme avec les threads:
 
manu@manu manu $ c++ thread.cpp
/tmp/ccIVHPuu.o(.text+0x6e): In function `main':
: undefined reference to `boost::thread::thread[in-charge](boost::function0<void, boost::empty_function_policy, boost::empty_function_mixin, std::allocator<boost::function_base> > const&)'
/tmp/ccIVHPuu.o(.text+0xa5): In function `main':
: undefined reference to `boost::thread::join()'
/tmp/ccIVHPuu.o(.text+0xb8): In function `main':
: undefined reference to `boost::thread::~thread [in-charge]()'
/tmp/ccIVHPuu.o(.text+0xd1): In function `main':
: undefined reference to `boost::thread::~thread [in-charge]()'
/tmp/ccIVHPuu.o(.gnu.linkonce.t._ZN12thread_alarmclEv+0x15): In function `thread_alarm::operator()()':
: undefined reference to `boost::xtime_get(boost::xtime*, int)'
/tmp/ccIVHPuu.o(.gnu.linkonce.t._ZN12thread_alarmclEv+0x34): In function `thread_alarm::operator()()':
: undefined reference to `boost::thread::sleep(boost::xtime const&)'
collect2: ld returned 1 exit status
manu@manu manu $
 
Je ne vois nulle part ce type d'erreur sur leur site, tu ne peux pas m'aider ?

mood
Publicité
Posté le 05-05-2003 à 14:01:38  profilanswer
 

n°382645
Taz
bisounours-codeur
Posté le 05-05-2003 à 14:11:36  profilanswer
 

RTFM^3

n°382670
djmanu22
Posté le 05-05-2003 à 14:19:01  profilanswer
 

ahhhhh j'ai trouvé c'était  
g++ foo.cpp -lboost_thread -lpthread
 
 
Merci qd meme :-)

n°382671
skeye
Posté le 05-05-2003 à 14:19:33  profilanswer
 

:whistle:


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  C++

  Qui a deja utilisé les lib Boost ?

 

Sujets relatifs
Plus de sujets relatifs à : Qui a deja utilisé les lib Boost ?


Copyright © 1997-2025 Groupe LDLC (Signaler un contenu illicite / Données personnelles)