This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Help! extern C linkage for thread entry functions


Hi, 

I'm working on the EB40A board and my application is
in C++. Mine is a multi file application and I use a
common header file and include it in all my cc files.
I do have a #ifndef ... #define directive in my header
file to avoid multiple declarations. 

But still when I try to make it all, I get multiple
reference errors. But if the application is in C, the
whole thing compiles and works fine. 

I kind of figured that it is somewhat related to
declaring the thread entry functions within the extern
C block. But I'm not sure. How do I declare the thread
entry functions in C++. i.e if my thread function is
"Read_FIFO"  can I say

extern "C"  {
	cyg_thread_entry_t Read_FIFO;
}

or extern "C"  {
	void Read_FIFO(cyg_addrword_t );
}

In the first case I'm getting the multiple definition
erros, and in the second case I'm getting a conflict
with the previous declaration of
cyg_thread_entry_t Read_FIFO.

Can someone please help me. Thanks in advance. 

Giri.


	
		
__________________________________
Do you Yahoo!?
Vote for the stars of Yahoo!'s next ad campaign!
http://advision.webevents.yahoo.com/yahoo/votelifeengine/

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]