[MINC-users] ON Building the ezminc examples

Vladimir S. FONOV vladimir.fonov at gmail.com
Tue Feb 8 14:54:09 EST 2011


Hello Everybody,


I found the source of this problem in minc.h header (part of minc
distribution). Inside there are some definitions of functions
surrounded by usual.

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

... blah ...

#ifdef __cplusplus
}
#endif /* __cplusplus */


but, some functions are defined in minc_compat.h which doesn't have
this preprocessor macros.

The quick fix for ezminc to compile is to edit file
minc_io/minc_1_rw.h and replace #include <minc.h> with

extern "C" {
#include <minc.h>
}


But Ideally minc.h should be fixed instead.


P.S. Strangely enough problem doesn't seem to manifest itself with gcc
4.3 and older.


On Mon, Feb 7, 2011 at 9:05 PM, Li Wei <lwthucs at gmail.com> wrote:
> Hi All:
>
> I have a trouble when dealing with the ezminc examples when linking. I have
> installed the minc in the folder (/usr/local) as the prefix. I have checked
> the /usr/local/lib/ for the libraries and they are all there. The error
> reported is like follows:
>
> Linking CXX executable any_itk_any
> ../minc_io/libminc_io.a(minc_1_rw.o): In function
> `minc::minc_1_base::history() const':
> minc_1_rw.cpp:(.text+0x60e): undefined reference to `MI2attinq(int, int,
> char const*, int*, int*)'
> ../minc_io/libminc_io.a(minc_1_rw.o): In function
> `minc::minc_1_base::var_number() const':
> minc_1_rw.cpp:(.text+0x78c): undefined reference to `MI2inquire(int, int*,
> int*, int*, int*)'
> ../minc_io/libminc_io.a(minc_1_rw.o): In function
> `minc::minc_1_base::var_name(int) const':
>
> However, I have used nm to check the /usr/local/lib/libminc2.a it shows
>
> $ nm libminc2.a |grep MI2attinq
>         U MI2attinq
>         U MI2attinq
>         U MI2attinq
> 000000b0 T MI2attinq
>         U MI2attinq
>
> I have set the cmake path MINC path to /usr/local but I am not sure what I
> have done wrong. Hope for your kind help. Thanks
>
> --
> Best Regards,
> LI Wei
> IIIS, Tsinghua University
> _______________________________________________
> MINC-users at bic.mni.mcgill.ca
> http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users
>



-- 
Best regards,

 Vladimir S. Fonov ~ vladimir <dot> fonov <at> gmail <dot> com


More information about the MINC-users mailing list