C++Builder Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
C++빌더 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
메신저 프로젝트
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
볼랜드포럼 광고 모집

C++빌더 Q&A
C++Builder Programming Q&A
[46269] Borland C++ 6.0 Builder에서 Matlab 함수 호출하는 법에 대해 알고 싶습니다.
민배현 [minbaemandoo] 1890 읽음    2006-08-23 10:32
안녕하세요,

Borland C++ 6.0 Builder에서 Matlab 함수를 호출하는 법에 대해 알고 싶습니다.

주로 나와 있는 예제들은 MS Visual C++ 에서 Matlab을 불러오는 것이라...

볼랜드 C++의 Project - Option - Directories/Conditional - Directories 부분에서 Matlab의 include file과 library file은 링크시켰는데, 그 후 프로그램을 작성하면 compile 및 실행 시 에러가 발생합니다. 제가 쓴 예제와 에러는 다음과 같습니다.


//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include <stdio.h>
#include <stdlib.h>
#include "engine.h" // This file is needed to call the subroutines needed to call the MATLAB 6.0


Engine *ep;
mxArray *mp, *ans;
double *ar, *detreal;
int i, j;

#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
    : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{

    mp = mxCreateDoubleMatrix(3, 3, 0);
    mxSetName(mp, "A");
    ar = mxGetPr(mp);

    for(i=1;i<4;i++)
    {
        for(j=1;j<4;j++)
        {
            ar[i-1+3*(j-1)] = j*j*i*i;
        }
    }

}
//---------------------------------------------------------------------------

1. Compile 시 발생하는 에러입니다.
[C++ Warning] Unit1.cpp(31): W8006 Initializing mxComplexity with int
[C++ Error] Unit1.cpp(32): E2219 Wrong number of arguments in call of macro 'mxSetName'
[C++ Error] Unit1.cpp(32): E2379 Statement missing ;

2. Compile 시 발생하는 부분인  " mxSetName(mp, "A");  "  부분을 주석처리 해서 실행시키면 다음과 같은 실행 에러가 나타납니다.
[Linker Error] Unresolved external '_mxCreateDoubleMatrix' referenced from C:\DOCUMENTS AND SETTINGS\민배현\바탕 화면\8.22 C++에서 MATLAB 호출\UNIT1.OBJ
[Linker Error] Unresolved external '_mxGetPr' referenced from C:\DOCUMENTS AND SETTINGS\민배현\바탕 화면\8.22 C++에서 MATLAB 호출\UNIT1.OBJ

해결책을 모르겠습니다...어떻게 해야 볼랜드에서 매트랩을 호출할 수 있는 걸까요?

+ -

관련 글 리스트
46269 Borland C++ 6.0 Builder에서 Matlab 함수 호출하는 법에 대해 알고 싶습니다. 민배현 1890 2006/08/23
46312     Re:Borland C++ 6.0 Builder에서 Matlab 함수 호출하는 법에 대해 알고 싶습니다. 왕대박 2197 2006/08/25
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.