* extern "C" won't compile
@ 1999-10-08 6:24 ygillard
1999-10-31 13:57 ` ygillard
0 siblings, 1 reply; 2+ messages in thread
From: ygillard @ 1999-10-08 6:24 UTC (permalink / raw)
To: help-gcc
Hello
I am using extern "C" in my code and when I try to compile using
egcs 2.91.66 under solaris 7, I get the following error:
In function `void * CThreadFunction(void *)':
BufferOverflowManagerSingleton.hxx:79: previous declaration of `void *
CThreadFunction(void *)' with C++ linkage
BufferOverflowManagerSingleton.cxx:28: conflicts with new declaration
with C linkage
BufferOverflowManagerSingleton.hxx: In function `void
CThreadCleanup(void *)':
BufferOverflowManagerSingleton.hxx:82: previous declaration of `void
CThreadCleanup(void *)' with C++ linkage
BufferOverflowManagerSingleton.cxx:38: conflicts with new declaration
with C linkage
I try to put friend extern "C" void * CThreadFunction(void * theArg) in
my header file, but the cxx files including this header file do not
compile. I get:
empty component declaration
parse error before string constant
Here is my source code, I just can't figure out what I am doing wrong
Thanks For your help.
in my header file I have:
class BufferOverflowManagerSingleton
{
public:
...
private :
//this is a global C function used for launching threads
friend void * CThreadFunction(void * theArg);
//this is a global C function used for cleaning the thread
friend void CThreadCleanup(void * theArg);
};
in my cxx file I have:
...
extern "C" void * CThreadFunction(void * theArg)
{
..
}
extern "C" void CThreadCleanup(void * theArg)
{
...
}
...
Thanks a lot
Yves
Sent via Deja.com http://www.deja.com/
Before you buy.
^ permalink raw reply [flat|nested] 2+ messages in thread
* extern "C" won't compile
1999-10-08 6:24 extern "C" won't compile ygillard
@ 1999-10-31 13:57 ` ygillard
0 siblings, 0 replies; 2+ messages in thread
From: ygillard @ 1999-10-31 13:57 UTC (permalink / raw)
To: help-gcc
Hello
I am using extern "C" in my code and when I try to compile using
egcs 2.91.66 under solaris 7, I get the following error:
In function `void * CThreadFunction(void *)':
BufferOverflowManagerSingleton.hxx:79: previous declaration of `void *
CThreadFunction(void *)' with C++ linkage
BufferOverflowManagerSingleton.cxx:28: conflicts with new declaration
with C linkage
BufferOverflowManagerSingleton.hxx: In function `void
CThreadCleanup(void *)':
BufferOverflowManagerSingleton.hxx:82: previous declaration of `void
CThreadCleanup(void *)' with C++ linkage
BufferOverflowManagerSingleton.cxx:38: conflicts with new declaration
with C linkage
I try to put friend extern "C" void * CThreadFunction(void * theArg) in
my header file, but the cxx files including this header file do not
compile. I get:
empty component declaration
parse error before string constant
Here is my source code, I just can't figure out what I am doing wrong
Thanks For your help.
in my header file I have:
class BufferOverflowManagerSingleton
{
public:
...
private :
//this is a global C function used for launching threads
friend void * CThreadFunction(void * theArg);
//this is a global C function used for cleaning the thread
friend void CThreadCleanup(void * theArg);
};
in my cxx file I have:
...
extern "C" void * CThreadFunction(void * theArg)
{
..
}
extern "C" void CThreadCleanup(void * theArg)
{
...
}
...
Thanks a lot
Yves
Sent via Deja.com http://www.deja.com/
Before you buy.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1999-10-31 13:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-10-08 6:24 extern "C" won't compile ygillard
1999-10-31 13:57 ` ygillard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).