LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

SIT Compiler unable to link!

I have a problem trying to use the simulation interface toolkit. When I go to build my project and create an NI DLL all the code compiles correctly and then fails when linking. I have attached the error messages which have not pointed me anywhere usefull. If anyone has any usefull thought I would apreciate hearing them.

-Dan

Error executing build command: Error using ==> make_rtw
Error using ==> rtw_c
Error(s) encountered while building model "hga_twoaxistwomode"

link /DEBUG:full /DEBUGTYPE:cv /NODEFAULTLIB:LIBC /INCREMENTAL:NO /NOLOGO -subsystem:console,4.0 msvcrt.lib kernel32.lib ws2_32.lib mswsock.lib advapi32.lib C:\apps\matlab\my6\rtw\c\lib\win32\rtwlib_vc.lib @hga_twoaxistwomode.lnk /dll -out:hga_twoaxistwomode.dll
LIBCD.lib(dbgheap.obj) : error LNK2005: _malloc already defined in msvcrt.lib(MSVCR71.dll)
LIBCD.lib(dbgheap.obj) : error LNK2005: _calloc already defined in msvcrt.lib(MSVCR71.dll)
LIBCD.lib(dbgheap.obj) : error LNK2005: _free already defined in msvcrt.lib(MSVCR71.dll)
LIBCD.lib(crt0dat.obj) : error LNK2005: _exit already defined in msvcrt.lib(MSVCR71.dll)
LIBCD.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in msvcrt.lib(cinitexe.obj)
LIBCD.lib(crt0init.obj) : error LNK2005: ___xc_a already defined in msvcrt.lib(cinitexe.obj)
LIBCD.lib(crt0init.obj) : error LNK2005: ___xi_z already defined in msvcrt.lib(cinitexe.obj)
LIBCD.lib(crt0init.obj) : error LNK2005: ___xi_a already defined in msvcrt.lib(cinitexe.obj)
LIBCD.lib(winxfltr.obj) : error LNK2005: ___CppXcptFilter already defined in msvcrt.lib(MSVCR71.dll)
LIBCD.lib(dbgheap.obj) : warning LNK4006: _malloc already defined in msvcrt.lib(MSVCR71.dll); second definition ignored
LIBCD.lib(dbgheap.obj) : warning LNK4006: _calloc already defined in msvcrt.lib(MSVCR71.dll); second definition ignored
LIBCD.lib(dbgheap.obj) : warning LNK4006: _free already defined in msvcrt.lib(MSVCR71.dll); second definition ignored
LIBCD.lib(crt0dat.obj) : warning LNK4006: _exit already defined in msvcrt.lib(MSVCR71.dll); second definition ignored
LIBCD.lib(crt0init.obj) : warning LNK4006: ___xc_z already defined in msvcrt.lib(cinitexe.obj); second definition ignored
LIBCD.lib(crt0init.obj) : warning LNK4006: ___xc_a already defined in msvcrt.lib(cinitexe.obj); second definition ignored
LIBCD.lib(crt0init.obj) : warning LNK4006: ___xi_z already defined in msvcrt.lib(cinitexe.obj); second definition ignored
LIBCD.lib(crt0init.obj) : warning LNK4006: ___xi_a already defined in msvcrt.lib(cinitexe.obj); second definition ignored
LIBCD.lib(winxfltr.obj) : warning LNK4006: ___CppXcptFilter already defined in msvcrt.lib(MSVCR71.dll); second definition ignored
Creating library hga_twoaxistwomode.lib and object hga_twoaxistwomode.exp
LINK : warning LNK4098: defaultlib 'LIBCD' conflicts with use of other libs; use /NODEFAULTLIB:library
hga_twoaxistwomode.dll : fatal error LNK1169: one or more multiply defined symbols found
NMAKE : fatal error U1077: 'link' : return code '0x491'
Stop.
0 Kudos
Message 1 of 4
(2,843 Views)
Hi Daniel,
I replied to your email support request. The issue is that you are using MSVC++ 7.0 .NET compiler. I will paste the response here for others to see:

Unfortunately, we currently do not support any .NET compilers officially:
http://digital.ni.com/public.nsf/websearch/5F3B544A7FB806E886256F6A005D3F5B?OpenDocument

The first item in the "Known Issues" in the readme linked below discusses this:
ftp://ftp.ni.com/support/labview/windows/toolkits/SIT/SIT_2_0_3_readme.html

I would also recommend installing the latest patch at:
http://digital.ni.com/softlib.nsf/websearch/CB915E4A76A7046A86256F0E00521882?opendocument&node=132070_US

What we have seen is that MSVC++ 7.1 .NET seems to work. I say "seems to work" because it is not something we have tested complete, thus we cannot officially support it. If you have MSVC++ 7.1 .NET, you will need to modify the TMF file slightly and configure it to compile for VC 5.0. The readme linked above mentions this. Basically, you'll have comment out one line and uncomment another line using a text editor. I have attached a screenshot below showing the part of the TMF file that I'm talking about. The TMF file that you need to edit is at c:\SimulationInterfaceToolkit\ModelInterface.

As I mentioned before, this is simply a workaround, and not an officially supported procedure. But I'm pretty confident that this should work. If all else fails, you may need to downgrade to a supported version such as 5.0 or 6.0. Sorry if this causes much inconvenience, but I hope we can provide some sort of solution for you.
Anu Saha
Academic Product Marketing Engineer
National Instruments
0 Kudos
Message 2 of 4
(2,824 Views)
I have gotten a copy of MS VC++ 6.0 and have now been able to compile and link just fine. However I have run in to a new snag. It turns out when I go to run the generated code. I get an exception when the SIT server goes to launch. I have attached a screen capture of the error message. It appears that following this error message the SIT Server continues to run, and I must quit LabView to be able to stop the server, however I can not connect to it through VI that SIT Dialog created for me that has worked fine when running directly in Simulink.

Any thoughts on what could be causing this issue?
0 Kudos
Message 3 of 4
(2,806 Views)
Hi Michael,
I have sent you a reply to the email you sent regarding this question. To clarify, when you run Matlab, it starts up the SIT Server just fine. The Simulink model by itself runs fine. But, while the SIT Server is running, if you try to run the generated LabVIEW VI linked to the Simulink model, you get the exception error you mentioned. Is that correct? Can you run the generated VI that

Make sure that the default SIT Server port (port 6011 as displayed in Matlab) is not used by any other device or software on your PC. You can try to change the SIT Server port as described in page 10 of the SIT User Guide. Also, try running the generated VIs that DO NOT use the SIT Server. These are the VIs that are generated with _base in their names. Look in page 29 of the user guide linked above.

As I had mentioned, it seems like a good idea to uninstall all the software, and reinstall it freshly again. The uninstalling of VC++ 7.0 and installing of VC++ 6.0 may have left some links behind that are causing these problems. Rather than messing with volatile registry keys, a clean install is the best idea.

Hope this helps. Have a great day!
Anu Saha
Academic Product Marketing Engineer
National Instruments
0 Kudos
Message 4 of 4
(2,794 Views)