Historique des modifications - Message

Message #948

Sujet: Thread 2 (linux et windows)


Type Date Auteur Contenu
Dernière modification 04-01-2007 09:57:16 Jerry Kan
Je suis en train d'essayer ca depuis un moment ce matin,
en fait je n'arrive pas a faire marcher le tout (pas testé sous linux), je suis sous code::block (meme erreur sous dev) , j'avoue que je suis pas tres habitué a windows (beuurk ^^ ) donc je rate peut etre un truc tout simple

j'ai créé un le .h et le .cpp comme tu le décrit, je clique sur le truc pour compiler et la :


Project   : Console application
Compiler  : GNU GCC Compiler (called directly)
Directory : C:\\Documents and Settings\\laurent\\Bureau\	h2\\
--------------------------------------------------------------------------------
Switching to target: default
Compiling: main.cpp
In file included from main.cpp:2:
mythread.h:29: error: expected constructor, destructor, or type conversion before '=' token
mythread.h:29: error: expected `,' or `;' before '=' token
main.cpp: In function `long unsigned int maFonc(void*)':
main.cpp:23: error: cannot convert `CRITICAL_SECTION' to `_CRITICAL_SECTION*' for argument `1' to `void EnterCriticalSection(_CRITICAL_SECTION*)'
main.cpp:27: error: cannot convert `CRITICAL_SECTION' to `_CRITICAL_SECTION*' for argument `1' to `void LeaveCriticalSection(_CRITICAL_SECTION*)'
main.cpp:32: warning: converting to non-pointer type `long unsigned int' from NULL
main.cpp: In function `int main()':
main.cpp:41: error: cannot convert `CRITICAL_SECTION' to `_CRITICAL_SECTION*' for argument `1' to `void InitializeCriticalSection(_CRITICAL_SECTION*)'
main.cpp:51: error: invalid conversion from `void*' to `void* const*'
main.cpp:51: error:   initializing argument 2 of `DWORD WaitForMultipleObjects(DWORD, void* const*, BOOL, DWORD)'
main.cpp:57: error: `mutex' undeclared (first use this function)
main.cpp:57: error: (Each undeclared identifier is reported only once for each function it appears in.)
main.cpp:62:3: warning: no newline at end of file
Process terminated with status 1 (0 minutes, 1 seconds)
10 errors, 1 warnings

la premiere des erreurs corresponds a la ligne :

*(thrd) = CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)(fct),(param),0,NULL)

éventuellement tu aurait un zip d'un exemple comprenant les sources et le .cbp (ou le .dev) ?
Création du message 04-01-2007 09:54:10 Jerry Kan
Je suis en train d'essayer ca depuis un moment ce matin,
en fait je n'arrive pas a faire marcher le tout (pas testé sous linux), je suis sous code::block (meme erreur sous dev) , j'avoue que je suis pas tres habitué a windows (beuurk ^^ ) donc je rate peut etre un truc tout simple

j'ai créé un le .h et le .cpp comme tu le décrit, je clique sur le truc pour compiler et la :


Project   : Console application
Compiler  : GNU GCC Compiler (called directly)
Directory : C:\\Documents and Settings\\laurent\\Bureau\	h2\\
--------------------------------------------------------------------------------
Switching to target: default
Compiling: main.cpp
In file included from main.cpp:2:
mythread.h:29: error: expected constructor, destructor, or type conversion before '=' token
mythread.h:29: error: expected `,' or `;' before '=' token
main.cpp: In function `long unsigned int maFonc(void*)':
main.cpp:23: error: cannot convert `CRITICAL_SECTION' to `_CRITICAL_SECTION*' for argument `1' to `void EnterCriticalSection(_CRITICAL_SECTION*)'
main.cpp:27: error: cannot convert `CRITICAL_SECTION' to `_CRITICAL_SECTION*' for argument `1' to `void LeaveCriticalSection(_CRITICAL_SECTION*)'
main.cpp:32: warning: converting to non-pointer type `long unsigned int' from NULL
main.cpp: In function `int main()':
main.cpp:41: error: cannot convert `CRITICAL_SECTION' to `_CRITICAL_SECTION*' for argument `1' to `void InitializeCriticalSection(_CRITICAL_SECTION*)'
main.cpp:51: error: invalid conversion from `void*' to `void* const*'
main.cpp:51: error:   initializing argument 2 of `DWORD WaitForMultipleObjects(DWORD, void* const*, BOOL, DWORD)'
main.cpp:57: error: `mutex' undeclared (first use this function)
main.cpp:57: error: (Each undeclared identifier is reported only once for each function it appears in.)
main.cpp:62:3: warning: no newline at end of file
Process terminated with status 1 (0 minutes, 1 seconds)
10 errors, 1 warnings

la premiere des erreurs corresponds a la ligne :

*(thrd) = CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)(fct),(param),0,NULL)

éventuellement tu aurait un zip d'un exemple comprenant les sources et le .cbp (ou le .dev) ?

Retour

Options Liens officiels Caractéristiques Statistiques Communauté
Préférences cookies
Corrections
irrlicht
irrklang
irredit
irrxml
Propulsé par Django
xhtml 1.0
css 2.1
884 membres
1440 sujets
11337 messages
Dernier membre inscrit: Saidov17
216 invités en ligne
membre en ligne: -
RSS Feed