Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » undefined reference to EXTERNC c++ function in C(undefined reference to EXTERNC c++ function in C)
undefined reference to EXTERNC c++ function in C [message #1072891] Tue, 23 July 2013 18:23 Go to next message
W Z is currently offline W ZFriend
Messages: 2
Registered: July 2013
Junior Member


I have a EXTERNC c++ function prototype in a lcca.h file

EXTERNC int lccaReceive(lcca_ptr myLccaPtr, tHdb10Word* data,
UINT16 maxWords, UINT16 actualWords,
INT32 maxWaitMs, int bypassStats);

the definition of the function is in a lcca.cpp file

int lccaReceive(lcca_ptr myLccaPtr, tHdb10Word* data,
UINT16 maxWords, UINT16& actualWords,
INT32 maxWaitMs, int bypassStats){
Lcca* typedLccaPtr = static_cast<Lcca*>(myLccaPtr);
return typedLccaPtr->Receive(data, maxWords, actualWords,
maxWaitMs, !!bypassStats);

call the function in a lccaCall.c file , and lcca.h is included.
it errors out:

undefined reference to lccaReceive.

How to resolve it? Thanks for your help.
Re: undefined reference to EXTERNC c++ function in C [message #1072942 is a reply to message #1072891] Tue, 23 July 2013 20:09 Go to previous message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 7/23/2013 12:24 PM, W Z wrote:
>
>
> I have a EXTERNC c++ function prototype in a lcca.h file
>
> EXTERNC int lccaReceive(lcca_ptr myLccaPtr, tHdb10Word* data,
> UINT16 maxWords, UINT16 actualWords,
> INT32 maxWaitMs, int bypassStats);
>
> the definition of the function is in a lcca.cpp file
>
> int lccaReceive(lcca_ptr myLccaPtr, tHdb10Word* data, UINT16 maxWords,
> UINT16& actualWords,
> INT32 maxWaitMs, int bypassStats){
> Lcca* typedLccaPtr = static_cast<Lcca*>(myLccaPtr);
> return typedLccaPtr->Receive(data, maxWords, actualWords,
> maxWaitMs, !!bypassStats);
>
> call the function in a lccaCall.c file , and lcca.h is included.
> it errors out:
>
> undefined reference to lccaReceive.
> How to resolve it? Thanks for your help.

This forum doesn't answer questions on C/C++. If you think it's an
Eclipse question, you could re-ask in the Eclipse CDT forum. More likely
though, it's failure to have lcca.h in a subdirectory that's the object
of -I on the compiler command line in your Makefile.

Best of luck.
Previous Topic:undefined reference to EXTERNC c++ function in C
Next Topic:I cant load Gcc compiler in eclipse kepler
Goto Forum:
  


Current Time: Tue Apr 23 14:23:45 GMT 2024

Powered by FUDForum. Page generated in 0.03217 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top