From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating DLL from a Simulink Model generates LNK

I’m trying to create a DLL from a Simulink model for an NIVeriStand target.

 

There are NIVeriStand  specific ‘tlc’ and ‘tmf’ files , supplied.

 

The build appears to work fine but on closer inspection there is a Linker error

 

Here’s the tail end of the diagnostic file created :

……

### Compiling SOF_system_2b_R2914b.rc rc SOF_system_2b_R2914b.rc Microsoft (R) Windows (R) Resource Compiler Version 6.1.7600.16385 Copyright (C) Microsoft Corporation. All rights reserved. ### Linking ... D:\PROGRA~1\MATLAB\R2014b\sys\perl\win32\bin\perl D:\PROGRA~1\MATLAB\R2014b\rtw\c\tools\mkvc_lnk.pl SOF_system_2b_R2914b.lnk SOF_system_2b_R2914b.obj NIVeriStand_main.obj SOF_system_2b_R2914b_data.obj rtGetInf.obj rtGetNaN.obj rt_logging.obj rt_nonfinite.obj rt_sim.obj SOF_system_2b_R2914b.res link /RELEASE /INCREMENTAL:NO /NOLOGO -entry:_DllMainCRTStartup@12 -dll kernel32.lib advapi32.lib wsock32.lib @SOF_system_2b_R2914b.lnk /dll -out:SOF_system_2b_R2914b.dll Creating library SOF_system_2b_R2914b.lib and object SOF_system_2b_R2914b.exp LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt *** Created DLL C:\Users\evans_mv\NI Stand Data\R2014b\SOF_system_2b_R2914b_niVeriStand_rtw\SOF_system_2b_R2914b.dll C:\Users\evans_mv\NI Stand Data\R2014b\SOF_system_2b_R2914b_niVeriStand_rtw>exit /B 0 ### Successful completion of Real-Time Workshop build procedure for model: SOF_system_2b_R2914b

 

It claims to have created a ‘dll’ , but none was created.

 

I’m using R2014b ( and NI VeriStand 2014). (Windows 7)

 

Have you seen this kind of this before or do you know of anyone who might have ?

 

Many thanks

 

Mal

0 Kudos
Message 1 of 5
(5,143 Views)

Hello Mal,

 

Are you building using MSVC++ 2010? If so, this is a known issue as reported by Microsoft in the link below. The solution is to update your Visual Studio 2010 installation to SP1.

 

LNK1123 error when bulding VC++ 2010 project after installing Visual Studio 2012 or .NET Framework 4.5

https://support.microsoft.com/en-us/kb/2757355

Nestor
0 Kudos
Message 2 of 5
(5,136 Views)

Hi Nestor

 

Thanks for the advice, all fine now , Bon Noel !

 

mal

Message 3 of 5
(5,035 Views)

Hi Mal,

I'm having the same issues, I was wondering what you did to make it work?

 

I have tried installing .NET Framework 5.2 as per the Microsoft article with no luck.

 

Thanks,

 

Hans

0 Kudos
Message 4 of 5
(3,062 Views)

NEVS_Ludvig_0-1597994460479.png

This setup of Signals and Parameters solved this issue for me after checking I have the right SDK. 

0 Kudos
Message 5 of 5
(1,975 Views)