468,504 Members | 1,979 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,504 developers. It's quick & easy.

Gcc vs. Visual C++ compiler for Matlab

Hi,

I have compiled my cpp code in my matlab sucessfully using "mex" command. The compiler I used in "mex" is Visual C++ 8.0 compiler.
However, when I try to use gcc compiler instead for compile this file for matlab use in Linux environment, the compilation is not successful.
The error message I got is the following. Any hints or explanation would be appreciated. Thank you in advance.

gary


>> mex ldpc_encoder_prepros_c.cpp
ldpc_encoder_prepros_c.o: In function `CLDPCEncoderPreProc::UrbankeCH(int)':
ldpc_encoder_prepros_c.cpp:(.text+0x37d): undefined reference to `CLDPCEncoderPreProc::ColUnkown'
ldpc_encoder_prepros_c.o: In function `CLDPCEncoderPreProc::CLDPCEncoderPreProc(unsigned int, unsigned int, unsigned int, unsigned int, double const*, int const*, int const*, double const*)':
ldpc_encoder_prepros_c.cpp:(.text+0xb14): undefined reference to `CLDPCEncoderPreProc::ColUnkown'
ldpc_encoder_prepros_c.o: In function `CLDPCEncoderPreProc::UrbankeAH(int)':
ldpc_encoder_prepros_c.cpp:(.text+0xf93): undefined reference to `CLDPCEncoderPreProc::ColUnkown'
ldpc_encoder_prepros_c.o: In function `CLDPCEncoderPreProc::UrbankeCHT(int)':
ldpc_encoder_prepros_c.cpp:(.text+0x162e): undefined reference to `CLDPCEncoderPreProc::ColUnkown'
ldpc_encoder_prepros_c.o: In function `CLDPCEncoderPreProc::CLDPCEncoderPreProc(unsigned int, unsigned int, unsigned int, unsigned int, double const*, int const*, int const*, double const*)':
ldpc_encoder_prepros_c.cpp:(.text+0x2404): undefined reference to `CLDPCEncoderPreProc::ColUnkown'
collect2: ld returned 1 exit status
Jan 6 '08 #1
1 4415
weaknessforcats
9,207 Expert Mod 8TB
Undefined references occur in two places.

First, during the compile when you use something that has not been declared. If this is your situation , check that all header files have been included.

Second, things compile OK but die in the link due to unresolved references. Here you need to be sure that all sources files were part of the build and that all libraries were correctly added to the build.
Jan 6 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by dataangel | last post: by
3 posts views Thread by Mohammed Smadi | last post: by
9 posts views Thread by Carl | last post: by
2 posts views Thread by lord.tyranus.96 | last post: by
67 posts views Thread by Nimmi Srivastav | last post: by
reply views Thread by NPC403 | last post: by
3 posts views Thread by gieforce | last post: by
reply views Thread by fmendoza | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.