NI Home > Community > NI Discussion Forums

NI VeriStand

Reply
Member
Piju1508
Posts: 3
0 Kudos

Build Error for Simulink Model for Veristand 2011

Hello,

 

I am trying to do a built of an Simulink Model. I am getting a series of Link errors.

 

The model is an input port directly connected to an output port.

 

I am using Matlab 2007b, MS Visual c++ 6.0 and NI Veristand 2011. I am getting following Link errors (attached):

 

### Linking ...

C:\PROGRA~1\MATLAB\R2007b\sys\perl\win32\bin\perl C:\PROGRA~1\MATLAB\R2007b\rtw\c\tools\mkvc_lnk.pl Test_Mdl.lnk Test_Mdl.obj rt_logging.obj rt_nonfinite.obj NIVeriStand_main.obj rt_sim.obj Test_Mdl.res

link /RELEASE /NODEFAULTLIB /INCREMENTAL:NO /PDB:NONE /RELEASE /NOLOGO -entry:_DllMainCRTStartup@12 -dll kernel32.lib advapi32.lib wsock32.lib C:\VeriStand\2011\ModelInterface\tmw\lib\VC6.0\R2007b\RELEASE\rtwlib_sit.lib @Test_Mdl.lnk /dll -out:Test_Mdl.dll

Creating library Test_Mdl.lib and object Test_Mdl.exp

LINK : error LNK2001: unresolved external symbol __DllMainCRTStartup@12

Test_Mdl.obj : error LNK2001: unresolved external symbol _memset

rt_logging.obj : error LNK2001: unresolved external symbol _memset

NIVeriStand_main.obj : error LNK2001: unresolved external symbol _memset

rt_sim.obj : error LNK2001: unresolved external symbol __fltused

Test_Mdl.obj : error LNK2001: unresolved external symbol __fltused

rt_logging.obj : error LNK2001: unresolved external symbol __fltused

rt_nonfinite.obj : error LNK2001: unresolved external symbol __fltused

NIVeriStand_main.obj : error LNK2001: unresolved external symbol __fltused

Test_Mdl.obj : error LNK2001: unresolved external symbol __ftol

rt_logging.obj : error LNK2001: unresolved external symbol __ftol

Test_Mdl.obj : error LNK2001: unresolved external symbol _memcpy

rt_logging.obj : error LNK2001: unresolved external symbol _memcpy

Test_Mdl.obj : error LNK2001: unresolved external symbol __imp__strncpy

rt_logging.obj : error LNK2001: unresolved external symbol __imp__strncpy

NIVeriStand_main.obj : error LNK2001: unresolved external symbol __imp__strncpy

Test_Mdl.obj : error LNK2001: unresolved external symbol _strlen

rt_logging.obj : error LNK2001: unresolved external symbol _strlen

NIVeriStand_main.obj : error LNK2001: unresolved external symbol _strlen

Test_Mdl.obj : error LNK2001: unresolved external symbol __imp__printf

rt_logging.obj : error LNK2001: unresolved external symbol __imp__printf

Test_Mdl.obj : error LNK2001: unresolved external symbol __imp__free

rt_logging.obj : error LNK2001: unresolved external symbol __imp__free

Test_Mdl.obj : error LNK2001: unresolved external symbol __imp__sprintf

rt_logging.obj : error LNK2001: unresolved external symbol __imp__sprintf

Test_Mdl.obj : error LNK2001: unresolved external symbol __imp__calloc

rt_logging.obj : error LNK2001: unresolved external symbol __imp__calloc

Test_Mdl.obj : error LNK2001: unresolved external symbol _strcmp

rt_logging.obj : error LNK2001: unresolved external symbol _strcmp

Test_Mdl.obj : error LNK2001: unresolved external symbol __imp__atoi

Test_Mdl.obj : error LNK2001: unresolved external symbol __imp__strrchr

Test_Mdl.obj : error LNK2001: unresolved external symbol _strcpy

rt_logging.obj : error LNK2001: unresolved external symbol __imp__malloc

rt_logging.obj : error LNK2001: unresolved external symbol __imp__fprintf

NIVeriStand_main.obj : error LNK2001: unresolved external symbol __imp__fprintf

rt_logging.obj : error LNK2001: unresolved external symbol __imp___iob

NIVeriStand_main.obj : error LNK2001: unresolved external symbol __imp___iob

rt_logging.obj : error LNK2001: unresolved external symbol __imp__floor

rt_logging.obj : error LNK2001: unresolved external symbol __imp__strncat

rt_logging.obj : error LNK2001: unresolved external symbol __imp__strchr

rt_logging.obj : error LNK2001: unresolved external symbol __imp__exit

NIVeriStand_main.obj : error LNK2001: unresolved external symbol __imp__exit

rt_logging.obj : error LNK2001: unresolved external symbol __imp__realloc

rt_logging.obj : error LNK2001: unresolved external symbol __imp__ldexp

rt_logging.obj : error LNK2001: unresolved external symbol __imp__remove

rt_logging.obj : error LNK2001: unresolved external symbol __imp__fclose

rt_logging.obj : error LNK2001: unresolved external symbol __imp__fopen

rt_logging.obj : error LNK2001: unresolved external symbol __imp__fwrite

rt_logging.obj : error LNK2001: unresolved external symbol __imp__fread

rt_logging.obj : error LNK2001: unresolved external symbol __imp__rewind

rt_nonfinite.obj : error LNK2001: unresolved external symbol __imp___isnan

NIVeriStand_main.obj : error LNK2001: unresolved external symbol __imp__tolower

Test_Mdl.dll : fatal error LNK1120: 32 unresolved externals

NMAKE : fatal error U1077: 'link' : return code '0x460'

Stop.

 

D:\Data\f09561a\My Documents\MATLAB\Test_Mdl_niVeriStand_rtw>echo The make command returned an error of 2

The make command returned an error of 2

 

D:\Data\f09561a\My Documents\MATLAB\Test_Mdl_niVeriStand_rtw>An_error_occurred_during_the_call_to_make

'An_error_occurred_during_the_call_to_make' is not recognized as an internal or external command,

operable program or batch file.

### Real-Time Workshop build procedure for model: 'Test_Mdl' aborted due to an error.

>>

 

Any help in this regard is Appreciated.

 

Thanks,

Piju

 

 

 

Member
donowan
Posts: 1
0 Kudos

回复: Build Error for Simulink Model for Veristand 2011

I also met this problem,who can solve it?Please tell me,thanks very much!MY EMAIL:534193809@qq.com

Member
joshe
Posts: 55
0 Kudos

回复: Build Error for Simulink Model for Veristand 2011

[ Edited ]

Was this problem ever resolved?  I am having the same issues.  VS 2011 and Simulink 2012a (32bit).  MS Visual Studio 2008 pro.  Window 7 64bit.

Member
joshe
Posts: 55
0 Kudos

回复: Build Error for Simulink Model for Veristand 2011

NI came through!!  Here is what they said and I got it to work.

 

Essentially, we call into the MSVC makefile macro to retrieve some of our linker arguments, and the MSVC macro enables the culprit flag (/NODEFAULTLIB).

First of all, let's confirm that you have "Windows SDK for Windows 7 and .NET Framework 3.5 SP1".  If you downloaded it from our knowledgebase article, then this version should be correct!  Our concern was this was a bug with the SDK but a service pack addressed the issue on MSVC side.

Now, we'll want to backup and modify this macro so that we can modify it.  See the steps below:
1) Locate Win32.Mak. Unfortunately, the location this can live in cannot be identified in a straight forward way.  You'll want to use Windows Search and search for "Win32.Mak" and repeat steps 2 and 3 until it works.  On our system (which has different versions of MSVC and SDK installed), we found it at the following location:
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\Win32.Mak

2) Create a backup of this file. DO NOT simply copy and paste this item in a different location because it may fall under the search paths. Instead, append the extension *.bak to the copied file.

3) Open Win32.mak and search for dlllflags . Trace through its definition and confirm that /NODEFAULTLIB is indeed part of its definition. If so, remove it