Model Builder.zip
Hơi dài mọi người chịu khó xem và giúp đỡ mình [IMG]images/smilies/biggrin.png[/IMG]
Mình đang dùng Visual C++ 2008 Express, mình làm theo hướng dẫn add Model Builder trong file đính kèm vào Property Manager, add thêm C++ Class là Adder với Base class là: AgilentEEsof:[IMG]images/smilies/biggrin.png[/IMG]FModel
Rồi sửa Adder.h là:
Mã:
#pragma once
#include "ModelBuilder.h"
class Adder :
public AgilentEEsof::DFModel
{
public:
double In1, In2; // Inputs
double Out; // Outputs
double Gain; // Parameters
DECLARE_MODEL_INTERFACE(Adder); // Declare modelbuilder interface
virtual bool Run(); // Method for scientific code during each
invocation of the model
virtual bool Initialize(); // This method is invoked before the start
of simulation
};
Sửa Adder.cpp là:
Mã:
#include "stdafx.h"
#include "Adder.h"
DEFINE_MODEL_INTERFACE(Adder)
{
ADD_MODEL_INPUT(In1);
ADD_MODEL_INPUT(In2);
ADD_MODEL_OUTPUT(Out);
Gain = 0; // Default Value
ADD_MODEL_PARAM(Gain);
return true;
}
bool Adder::Initialize()
{
if (Gain ==0)
{
POST_ERROR("The value of Gain cannot be == 0");
return false;
}
return true;
}
bool Adder::Run()
{
Out = Gain * (In1 + In2);
return true;
}
Sau đó mình Build Solution thì bị lỗi
fatal error C1083: Cannot open include file: 'stdafx.h': No such file or directory
thì mình copy file stdafx.h và stdafx.cpp vô trong include ở trong thư mục cài đặt rồi chạy lại Build Solution thì lại bị lỗi tiếp như sau
------ Build started: Project: B, Configuration: Debug Win32 ------
Compiling...
Adder.cpp
d:\2\1\modelbuilder\include\modelbuilder.h(22) : fatal error C1189: #error : Runtime Library is set to /MDd or _DEBUG is defined in Preprocessor Definictions. The current project configuration is incompatible with SystemVue. To properly build a model library for SystemVue, change the Runtime Library configuration to /MD and remove _DEBUG from Preprocessor Definitations. You may define ENABLE_MODELBUILDER_MDD in Preprocessor Definitions to bypass the check.
Build log was saved at "file://c:\Documents and Settings\NTT\My Documents\Visual Studio 2008\Projects\B\B\Debug\BuildLog.htm"
B - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Bạn nào có thể giúp mình sửa lỗi, cách khắc phục được không.
Mình xin cảm ơn!
View more random threads:
xã hội vững mạnh, nhu cầu mặc đẹp của con người ngày càng cao. ngành công nghiệp thời trang cũng đang vững mạnh chóng vánh. những nhà máy gia công hàng may mặc chẳng thể đóng góp lặng thầm vào sự...
Tìm xưởng may gia công tại TP Hồ...