User forums > Using Code::Blocks

Error in linker, please help!

<< < (2/2)

manc:
MkMatriz and MkVector are defined in sel.c and declared in sel.h

alchemist:
ermm... you have C code compiled with the C++ compiler...

You have 2 alternatives :
- compile with gcc in place of g++
- surround each declaration of your C functions by


--- Code: ---#ifdef __cplusplus
extern "C" {
#endif

/* your declarations here */

#ifdef __cplusplus
}
#endif

--- End code ---

manc:
 :oops: Thanks, it compiles now!

alchemist:
No shame, everybody does that error. Even C++ is compatible with C, the linkage is different and you have to be careful when using C linked code with C++ ;)

Navigation

[0] Message Index

[*] Previous page

Go to full version