|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
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? |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
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. |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
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 > |
|
![]() |
| Outils de la discussion | |
|
|