PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.cplus > static member
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
static member

Réponse
 
LinkBack Outils de la discussion
Vieux 09/04/2008, 01h12   #1
Jim Johnson
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut static member

why following source file complied with error

http://www.oniva.com/upload/1356/ThreadX.cpp
http://www.oniva.com/upload/1356/ThreadX.h
http://www.oniva.com/upload/1356/Main.cpp

1>d:\c_htp\multithreading\part1listing1\threadx.cp p(15) : error C2724:
'ThreadX::ThreadStaticEntryPoint' : 'static' should not be used on
member functions defined at file scope

how to fix it?
  Réponse avec citation
Vieux 09/04/2008, 01h37   #2
Ian Collins
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: static member

Jim Johnson wrote:
> why following source file complied with error
>
> http://www.oniva.com/upload/1356/ThreadX.cpp
> http://www.oniva.com/upload/1356/ThreadX.h
> http://www.oniva.com/upload/1356/Main.cpp
>
> 1>d:\c_htp\multithreading\part1listing1\threadx.cp p(15) : error C2724:
> 'ThreadX::ThreadStaticEntryPoint' : 'static' should not be used on
> member functions defined at file scope
>
> how to fix it?


Remove the keyword static?

It's not a good idea to post links (people using virus prone OSs are
unlikely to open them), you should post a minimal, compilable example.

--
Ian Collins.
  Réponse avec citation
Vieux 09/04/2008, 08h59   #3
Jim Langston
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: static member

Jim Johnson wrote:
> why following source file complied with error
>
> http://www.oniva.com/upload/1356/ThreadX.cpp
> http://www.oniva.com/upload/1356/ThreadX.h
> http://www.oniva.com/upload/1356/Main.cpp
>
> 1>d:\c_htp\multithreading\part1listing1\threadx.cp p(15) : error C2724:
> 'ThreadX::ThreadStaticEntryPoint' : 'static' should not be used on
> member functions defined at file scope
>
> how to fix it?


This is a Microsoft error. Inside MSVC in the click on Index and type
in C2724 and read the full explanation.

Compiler Error C2724'identifier' : 'static' should not be used on member
functions defined at file scope

Static member functions should be declared with external linkage. Static
member functions at file scope cause an error under ANSI compatibility (/Za)
and a warning under Microsoft extensions (/Ze).

Example

// C2724.cpp
class C
{
static void func();
};

static void C::func(){}; // C2724




--
Jim Langston
tazmaster@rocketmail.com


  Réponse avec citation
Vieux 09/04/2008, 09h07   #4
Jim Langston
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: static member

tazmaster@rocketmail.com
"Jim Langston" <tazmaster@rocketmail.com> wrote in message
news:5I_Kj.2917$0w6.722@newsfe05.lga...
> Jim Johnson wrote:
>> why following source file complied with error
>>
>> http://www.oniva.com/upload/1356/ThreadX.cpp
>> http://www.oniva.com/upload/1356/ThreadX.h
>> http://www.oniva.com/upload/1356/Main.cpp
>>
>> 1>d:\c_htp\multithreading\part1listing1\threadx.cp p(15) : error C2724:
>> 'ThreadX::ThreadStaticEntryPoint' : 'static' should not be used on
>> member functions defined at file scope
>>
>> how to fix it?

>
> This is a Microsoft error. Inside MSVC in the click on Index and
> type in C2724 and read the full explanation.


I meant to say that C2724 was a Microsoft error code. The error would occur
in other compilers too. I thought I should explain that.

> --
> Jim Langston
> tazmaster@rocketmail.com
>



  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 02h23.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,11990 seconds with 12 queries