Templates and overloaded...

This is the forum for general discussion.

Moderator: 2ffat

Templates and overloaded...

Postby Alan » Tue Feb 07, 2006 10:27 am

Hello,

I work with Borlan C++ 5.02 and I have an error that I don't success to find solution:

This error is : "Templates and overloaded operators cannot have C linkage"

Could you help me? Or could you give me a link that give solutions?

Thank you for your help.
Alan
 

Postby stukelly » Tue Feb 07, 2006 5:45 pm

Here is an answer from the borland news groups.

Your header is included inside
extern "C" {
}

construct. This is illegal in C++ to declare template and overloaded
operators as extern "C"


Source http://groups.google.co.uk/group/borland.public.cppbuilder.winapi/browse_thread/thread/4f87eac202c2c349/e6e7d12c559fb254?

Can you post the full error or some code?

Stuart :)
stukelly
BCBJ Guru
BCBJ Guru
 
Posts: 132
Joined: Fri Jun 03, 2005 6:35 am
Location: Preston, UK

Postby Alan » Wed Feb 08, 2006 1:52 am

inline BOOL operator!=(const GUID& guidOne, const GUID& guidOther)
{?
return !(guidOne == guidOther);
}


? here is the error according to Borlan 5.02. When I click on the error message, Borlan 5.02 indicate to me that the error is on this line. Could you help me?
Alan
 

Postby stukelly » Wed Feb 08, 2006 2:46 am

I'll try me best to help.

It maybe something todo with the ordering of your header files. Are you using the VCL?

Which file was the error generated in?

Thanks Stuart :)
stukelly
BCBJ Guru
BCBJ Guru
 
Posts: 132
Joined: Fri Jun 03, 2005 6:35 am
Location: Preston, UK

Postby Guest » Wed Feb 08, 2006 5:15 am

the file which generate error et le fichier objbase.h and i have not command "extern C" in this header.

I unknow what is the VLC... Could you explain me I have not a sprcialist of C++ but I try to improve me... thank you
Guest
 

Postby Alan » Wed Feb 08, 2006 10:18 am

It was a problem of version because using "visual C" has deleted all the problem. Thank you for your help!
Alan
 


Return to General

Who is online

Users browsing this forum: No registered users and 3 guests