maomaowlw 0 Newbie Poster

Dear all,

I'm just swtching c++ programming from windows to Mac os. I had a program using matlab engine, which worked well in windows. When I tried to built it using Eclipse with gcc, it reports linking problems as follows:

**** Build of configuration Debug for project MatEng ****

make all
Building file: ../main.cpp
Invoking: GCC C++ Compiler
g++ -I/Applications/MATLAB_SV74/extern/include -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"main.d" -MT"main.d" -o"main.o" "../main.cpp"
Finished building: ../main.cpp

Building file: ../matEg.cpp
Invoking: GCC C++ Compiler
g++ -I/Applications/MATLAB_SV74/extern/include -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"matEg.d" -MT"matEg.d" -o"matEg.o" "../matEg.cpp"
Finished building: ../matEg.cpp

Building target: MatEng
Invoking: MacOS X C++ Linker
g++ -L/Applications/MATLAB_SV74/bin/maci -L/Applications/MATLAB_SV74/sys/os/maci -o "MatEng" ./main.o ./matEg.o
/usr/bin/ld: Undefined symbols:
_engClose
_engEvalString
_engGetVariable
_engOpen
_engOutputBuffer
_engPutVariable
_mxCreateDoubleMatrix_730
_mxDestroyArray
_mxGetM
_mxGetN
_mxGetPr
collect2: ld returned 1 exit status
make: *** [MatEng] Error 1

It should be due to errors in linking dynamic library, but I have added all necessary library directories & also set dynamic library path using "export DYLD_LIBRARY_PATH" in console... I spent hrs but still not able to find out the problem. Can any one help? Thanks!!