Hi my friends.
I hope somebody can help me.
I have included in my project (written in C++11) some files from a another author, which are written in C. I use Qt, so i have included next files in my project (Swaps.pro) there :
traces.c
schreier.c
...
A function which is called "Traces" are defined inside "traces.c" :
<code>
Traces(sparsegraph *g_arg, int *lab, int *ptn,
int *orbits_arg, TracesOptions *options_arg, TracesStats *stats_arg,
sparsegraph *canong_arg) {
//...
}
</code>
but, the linker still complains :
/home/daniel/programacion/Qt/Swaps/tracestest.cpp:-1: error: undefined reference to `Traces(sparsegraph*, int*, int*, int*, TracesOptions*, TracesStats*, sparsegraph*)'
Somebody have a idea what is happen ?
Thanks for any idea. Daniel
C doesn't mangle names, so if you try to declare a C function in a C++ source by just copy-pasting its signature, you'll generate a reference to a mangled symbol, which probably doesn't exist. extern"C" must be placed in front of the declaration: