Why do I receive C++ linking errors using the MATLAB Compiler on Redhat/Mandrake Linux?
Show older comments
Why do I receive C++ linking errors using the MATLAB Compiler on Redhat/Mandrake Linux?
When I do the following:
/usr/matlab/bin/mbuild -v ex1.cpp
I receive the following errors:
ERROR: ex1.o(.text+0x41): In function `main':: undefined reference to `mwArray::mwArray[in-charge](int, int, double*, double*, int)'ex1.o(.text+0x5a): In function `main':: undefined reference to `mwArray::mwArray[in-charge](int, int, double*, double*, int)'ex1.o(.text+0x68): In function `main':: undefined reference to `mwArray::Write(std::basic_ostream<char, std::char_traits<char> >&) const'ex1.o(.text+0x88): In function `main':: undefined reference to `mwArray::Write(std::basic_ostream<char, std::char_traits<char> >&) const'ex1.o(.text+0xcd): In function `main':: undefined reference to `mwArray::Read(std::basic_istream<char, std::char_traints<char> >&, int)'ex1.o(.text+0xdb): In function `main':: undefined reference to `mwArray::Write(std::basic_ostream<char, std::char_traits<char> >&) const'ex1.o(.text+0x25d): In function _static_initialization_and_destruction_0(int, int)':: undefined reference to `mwLibraryInitBuiltins::mwLibraryInitBuiltins[in-charge]()'ex1.o(.text+0x2bc): In function `__tcf_0':: undefined reference to `mwLibraryInitBuiltins::~mwLibraryInitBuiltins [in-charge]()'collect2: ld returned 1 exit status mbuild: link of 'ex1' failed.
Or, I might see:
ERROR: /usr/lib/libc_nonshared.a(elf-init.oS): In function `__libc_csu_init': elf-init.oS(.text+0xb): undefined reference to `__init_array_end'elf-init.oS(.text+0x10): undefined reference to `__init_array_start'elf-init.oS(.text+0x23): undefined reference to `__init_array_start'/usr/lib/libc_nonshared.a(elf-init.oS): In function `__libc_csu_fini':elf-init.oS(.text+0x36): undefined reference to `__fini_array_end'elf-init.oS(.text+0x3b): undefined reference to `__fini_array_start'
Accepted Answer
More Answers (0)
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!