[Débutant] boost::thread non-lvalue
Je viens tout juste de réussir à installer boost (enfin je crois) et mon premier programme test bugge :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
| #include <iostream>
#include <boost/thread/thread.hpp>
#include "fmod.h"
using namespace std;
int play_sound();
bool init_fmod();
int main()
{
cout << "Hello world!" << endl;
boost::thread mon_thread(&play_sound());
system("pause");
return 0;
}
bool init_fmod()
{
...
}
int play_sound()
{
if(init_fmod() == false) return 1;
FSOUND_SAMPLE *monSon;
monSon = FSOUND_Sample_Load(FSOUND_FREE, "son.wav", 0, 0, 0);
if(!monSon)
{
cout << "Erreur : son non valide : " << FMOD_ERRORS(FSOUND_GetError()) << endl;
}else{
FSOUND_PlaySound(FSOUND_FREE, monSon);
}
return 0;
} |
Le compilateur me renvoie l'erreur :
Citation:
error : non-lvalue in unary '&'
L'erreur vient-elle du code ou de l'installation de boost ?