Path: news.mathworks.com!not-for-mail
From: "Matthew Wade" <cosmicspacepig@googlemail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Further trouble compiling simulink model
Date: Wed, 30 Jul 2008 12:12:02 +0000 (UTC)
Organization: ttz-Bremerhaven
Lines: 84
Message-ID: <g6plqi$jtm$1@fred.mathworks.com>
Reply-To: "Matthew Wade" <cosmicspacepig@googlemail.com>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1217419922 20406 172.30.248.38 (30 Jul 2008 12:12:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 30 Jul 2008 12:12:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1052756
Xref: news.mathworks.com comp.soft-sys.matlab:482617



Hi,

Regarding this thread:
http://www.mathworks.com/matlabcentral/newsreader/view_threa
d/172200#445865

I solved the problem and successfully compiled a Rapid 
Simulation executable of a simulink model that can be 
updated etc.

I now have a new problem:

- I would like to compile a second simulink model which is 
a 2 reactor model (the model above is a 1 reactor model).

- The second model is identical to model one except that 
Reactor 1 output values feed into Reactor 2. The kinetics, 
stoichometry and states are similar but redefined, such 
that:
     - Reactor 1 S-function parameters: Kinetics, Stoich,  
General and X0
     - Reactor 2 S-function parameters: Kinetics2, Stoich2, 
General, X02 and XINF2 (where XINF2 = influent states from 
reactor 1)

So, GENERAL are basic parameters that are consistent with 
both reactors 1 and 2 (e.g. temperature).

- Now, I apply exactly the same compilation 
procedure/configuration that I did for the 1 reactor model 
and get errors in the Linking (see code at bottom). The 
errors translate (from Spanish) as:

-> reactor2.obj: error LNK2005: _CalcDerivBiololog already 
been defined in reactor.obj 

-> .. \ anaerobio_2R.exe: fatal error LNK1169: there were 
one or more symbols defined simultaneously 

-> NMAKE: fatal error U1077: 'link': x491 code returned'0 ' 
Stop.

I know the problem is something to do with conflicting 
files (e.g. i have reactor.c and reactor2.c, which are 
similar, but not identical).

Any thoughts would be appreciated.

Thanks
Matt

Error message below
________________________________________________
### Linking ... 
	C:\Programme\MATLAB71\sys\perl\win32\bin\perl 
C:\Programme\MATLAB71\rtw\c\tools\mkvc_lnk.pl 
anaerobio_2R.lnk anaerobio_2R.obj anaerobio_2R_data.obj 
rt_nonfinite.obj  rsim_main.obj rsim_sup.obj 
rsim_mat.obj    reactor.obj reactor2.obj  
	link /RELEASE  /INCREMENTAL:NO /NOLOGO -
subsystem:console,4.0  kernel32.lib  ws2_32.lib mswsock.lib 
advapi32.lib    C:\Programme\MATLAB71\rtw\c\lib\win32
\rtwlib_vc.lib C:\Programme\MATLAB71\rtw\c\lib\win32
\libut_vc.lib  C:\Programme\MATLAB71\rtw\c\lib\win32
\libmx_vc.lib  C:\Programme\MATLAB71\rtw\c\lib\win32
\libmat_vc.lib C:\Programme\MATLAB71\rtw\c\lib\win32
\rsim_engine_vc.lib @anaerobio_2R.lnk -
out:..\anaerobio_2R.exe 
reactor2.obj : error LNK2005: ya se defini? 
_CalcDerivBiololog en reactor.obj 
..\anaerobio_2R.exe : fatal error LNK1169: se encontraron 
uno o m?s s?mbolos definidos simult?neamente 
NMAKE : fatal error U1077: 'link' : c?digo devuelto '0x491' 
Stop. 
 
C:\Programme\MATLAB71
\work\Agrobiogas\GUI\agrobiogas_model\agrortw2
\anaerobio_2R_rsim_rtw>echo The make command returned an 
error of 2  
The make command returned an error of 2