Login Page - Create Account

Support Board


Date/Time: Fri, 03 May 2024 21:16:51 +0000



[Programming Help] - LINK : fatal error LNK1104: cannot open file 'C:\SierraChart\Data\your_dll_name.dll'

View Count: 1301

[2019-09-26 05:43:38]
User569373 - Posts: 13
Hi,

Today I got again the error "LINK : fatal error LNK1104: cannot open file 'C:\SierraChart\Data\your_dll_name.dll' ". This happens from time to time (weeks/months) during development.

Usually it happens after a crash of Sierra Chart due to my own programming errors. It doesn’t happen each time after a crash, but in my case it was after some crashes.

Symptoms: You suddenly get the error above when you build your advanced study DLL. In the message log window you see the line “Unloading DLL C:\SierraChart\Data\ your_dll_name.dll | 2019-09-26 01:04:46.745”. This says Sierra Chart tries to unload the DLL. It doesn’t matter if Sierra Chart was successful unloading -> in fact it was not. As an example, you can check with the Microsoft Sysinternal Tool “Process Explorer” (refer to other internet posts how doing this). There you can see, that the DLL is still connected to the Sierra Chart process. After a successful unload this is not the case.

“Release All DLLs and Deny load” does not help.
“Release Single DLLs and Deny load” does not help.
Freeing up the DLL via UDP Port (refer to other Sierra Chart posts) does not help.

My Solution: Perform a windows registry search with regedit. Search about your DLL name. In my case it was found the following entry:

[HKEY_USERS\S-1-5-21-137675215-4240082731-3378321674-1001\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers]

"C:\\SierraChart\\SierraChart_64.exe"="$ IgnoreFreeLibrary< your_dll_name.dll'.dll>"

IgnoreFreeLibrary: As I understood, this tells the OS to ignore DLL unload requests regarding this specific DLL. This entry suddenly appears. This is not only related to Sierra Chart.

It is good practice to export the Registry Hive you want to work on before you make changes to a registry entry. Remove ONLY the line regarding your DLL. In my case this was:

"C:\\SierraChart\\SierraChart_64.exe"="$ IgnoreFreeLibrary< your_dll_name.dll'.dll>"

Reboot the computer. If you are lucky you are done.

User569373
[2019-09-26 08:17:34]
Sierra Chart Engineering - Posts: 104368
Thank you for the information. We were not aware of this. It would explain, why it is that when users ask about a problem like this, we were never able to reproduce it because this registry entry never existed in our test cases and could see nothing wrong in the code either.

We are now going to log the error returned by FreeLibrary and not mark the DLL as released if there is an error.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2019-09-26 08:20:13

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account