Hello ever body!
I have a problema compiling a very simple program of linera algebra. I got messages like
mingw32-g++.exe -L"C:\Archivos de programa\CodeBlocks\lib" -o C:\Progs\MetNum\SEL\Gauss\Gauss.exe .objs\gauss.o .objs\sel.o .objs\main.o -mwindows
.objs\main.o:main.c:(.text+0xc7): undefined reference to `MkMatriz'
.objs\main.o:main.c:(.text+0xfe): undefined reference to `MkVector'
...
and other functions that really are in some of the modules.
Any idea?
Thanks!
What library is it in? Or if not in a library, what object file is it in?
Did you link to that library or Object file?
Tim S
This is a tiny project. The files are main.c, gauss.c, sel.c, and sel.h, the last one included in all .c modules.
Im using only ANSI C. It works fine in other IDEs: borland, Dev-C.
Whant to see the files? I can send them.
Miguel Angel
and where is the .c file with the definition of MkMatriz and MkVector ?
MkMatriz and MkVector are defined in sel.c and declared in sel.
Miguel
MkMatriz and MkVector are defined in sel.c and declared in sel.h
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
#ifdef __cplusplus
extern "C" {
#endif
/* your declarations here */
#ifdef __cplusplus
}
#endif
:oops: Thanks, it compiles now!
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++ ;)