Ошибка lnk1104 не удается открыть файл mscoree lib

Ну, я пытался создать C ++ DLL в Visual Studio 2015, что заняло какое-то время, так как я не очень хорош в Visual Studio.

Мне нужно получить доступ к библиотекам .NET, в частности System :: Management. (Написание кода было немного сложнее, чем требовалось из-за плохой реализации C ++, но, по крайней мере, он есть.)

Я исправил очевидные ошибки и, наконец, понял, что мне нужно включить CLR в свойствах проекта, а затем выбрать связанные библиотеки с помощью References-> Add Reference. Но после всего этого, теперь это просто странная ошибка:

LNK1104: cannot open file 'MSCOREE.lib'

Компилятор не показывает красные волнистые линии под чем-либо, и ошибка утверждает, что строка — «1», а файл — «ССЫЛКА», так что тут никакой помощи.

Я подумал, что, возможно, где-то испортил конфигурацию проекта, поэтому я создал новый проект и перенес код. Ошибка все еще произошла. Если я отключил CLR и прокомментировал .NET-зависимый код, сборка прошла без ошибок.

Поэтому я попытался создать новый проект из шаблона (Visual C ++ -> Win32 Console Application) и затем включить CLR, прежде чем делать что-либо еще. Затем я попробовал еще раз, выбрав разные версии .NET Framework.

Наконец, я попытался создать проект с шаблоном (Visual C ++ -> CLR -> CLR Console Application) и сразу же создать его. Я имею в виду буквально, не делая ничего другого. Это все еще дало ту же ошибку!

LNK1104: cannot open file 'MSCOREE.lib'

Что на земле происходит? Я что-то не так делаю или VS2015 просто сломан?

3

Решение

Попробуй это,
Щелкните правой кнопкой мыши проект, который показывает «LNK1104: невозможно открыть файл« MSCOREE.lib », затем выберите« Свойства »->« Свойства конфигурации »->« Каталоги VC ++ »->« Каталоги библиотек »-> Добавить обе записи снизу, разделенные точкой с запятой

C:Program Files (x86)Microsoft SDKsWindowsv7.1ALib
C:Program Files (x86)Microsoft SDKsWindowsv7.1ALibx64

Именно здесь должен быть ваш mscoree.lib, проверьте его там, прежде чем делать это, в противном случае вам может потребоваться установить / переустановить Microsoft SDK.

0

Другие решения

В некоторых ситуациях SDK может не установить необходимые файлы в папке LIB, как описано в MSCoree.lib отсутствует в WinSDK. Их решение состояло в том, чтобы выполнить ремонт установки. Это может не сработать.

Я успешно побежал WinSDKInterop_amd64WinSDKInterop_amd64.msi в результате чего создается:

C:Program FilesMicrosoft SDKsWindowsv7.1LibIA64mscoree.lib
C:Program FilesMicrosoft SDKsWindowsv7.1Libmscoree.lib
C:Program FilesMicrosoft SDKsWindowsv7.1Libx64mscoree.lib

0

Well, I’ve been trying to make a C++ DLL in Visual Studio 2015, which took a while since I’m not very good with Visual Studio.

I need to access the .NET libraries, specifically System::Management. (Writing the code was a little harder than it needed to be due to a poor C++ implementation, but at least it has one.)

I fixed obvious errors and finally figured out I had to enable CLR in the project properties and then select the related libraries with References->Add Reference. But after all that, now it’s just giving this weird error:

LNK1104: cannot open file 'MSCOREE.lib'

The compiler doesn’t show red wavy lines below anything, and the error claims the line is «1» and the file is «LINK», so no help there.

I thought I probably messed up the project configuration somewhere, so I created a new project and moved the code over. The error still happened. If I turned off CLR and commented out the .NET-dependent code, the build succeeded without errors.

So I tried creating a new project from template (Visual C++ -> Win32 Console Application) and then enabling CLR before doing anything else. Then I tried again, selecting different versions of .NET framework.

Finally, I tried creating a project with template (Visual C++ -> CLR -> CLR Console Application) and building it immediately. I mean literally without doing ANYTHING ELSE. It still gave the same error!

LNK1104: cannot open file 'MSCOREE.lib'

What on earth is going on? Am I doing something wrong here, or is VS2015 just broken?

RRS feed

  • Remove From My Forums
  • General discussion

  • I  have just installed Visual Studio 2008 Professional Edition.  I have created the simplest of programs from the Microsoft beginners tutorial and cannot get past the error created while linking «fatal error LNK1104: cannot open file ‘MSCOREE.lib’ «.

    • Changed type
      YiChun Chen
      Tuesday, May 12, 2009 3:21 AM
      Do not follow up

All replies

    • Edited by
      YiChun Chen
      Wednesday, May 6, 2009 9:47 AM
      typo
  • Hi Tjz1962,

    We are changing the issue type to “Comment” because you have not followed up with the necessary information. If you have more time to look at the issue and provide more information, please feel free to change the issue type back to “Question” by editing your initial post and changing the radio button at the top of the post editor window. If the issue is resolved, we will appreciate it if you can share the solution so that the answer can be found and used by other community members having similar questions.

    Thank you!


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.

Ну, я пытался создать C ++ DLL в Visual Studio 2015, что заняло какое-то время, так как я не очень хорош в Visual Studio.

Мне нужно получить доступ к библиотекам .NET, в частности System :: Management. (Написание кода было немного сложнее, чем требовалось из-за плохой реализации C ++, но, по крайней мере, он есть.)

Я исправил очевидные ошибки и, наконец, понял, что мне нужно включить CLR в свойствах проекта, а затем выбрать связанные библиотеки с помощью References-> Add Reference. Но после всего этого, теперь это просто странная ошибка:

LNK1104: cannot open file 'MSCOREE.lib'

Компилятор не показывает красные волнистые линии под чем-либо, и ошибка утверждает, что строка — «1», а файл — «ССЫЛКА», так что тут никакой помощи.

Я подумал, что, возможно, где-то испортил конфигурацию проекта, поэтому я создал новый проект и перенес код. Ошибка все еще произошла. Если я отключил CLR и прокомментировал .NET-зависимый код, сборка прошла без ошибок.

Поэтому я попытался создать новый проект из шаблона (Visual C ++ -> Win32 Console Application) и затем включить CLR, прежде чем делать что-либо еще. Затем я попробовал еще раз, выбрав разные версии .NET Framework.

Наконец, я попытался создать проект с шаблоном (Visual C ++ -> CLR -> CLR Console Application) и сразу же создать его. Я имею в виду буквально, не делая ничего другого. Это все еще дало ту же ошибку!

LNK1104: cannot open file 'MSCOREE.lib'

Что на земле происходит? Я что-то не так делаю или VS2015 просто сломан?

3

Решение

Попробуй это,
Щелкните правой кнопкой мыши проект, который показывает «LNK1104: невозможно открыть файл« MSCOREE.lib », затем выберите« Свойства »->« Свойства конфигурации »->« Каталоги VC ++ »->« Каталоги библиотек »-> Добавить обе записи снизу, разделенные точкой с запятой

C:Program Files (x86)Microsoft SDKsWindowsv7.1ALib
C:Program Files (x86)Microsoft SDKsWindowsv7.1ALibx64

Именно здесь должен быть ваш mscoree.lib, проверьте его там, прежде чем делать это, в противном случае вам может потребоваться установить / переустановить Microsoft SDK.

0

Другие решения

В некоторых ситуациях SDK может не установить необходимые файлы в папке LIB, как описано в MSCoree.lib отсутствует в WinSDK. Их решение состояло в том, чтобы выполнить ремонт установки. Это может не сработать.

Я успешно побежал WinSDKInterop_amd64WinSDKInterop_amd64.msi в результате чего создается:

C:Program FilesMicrosoft SDKsWindowsv7.1LibIA64mscoree.lib
C:Program FilesMicrosoft SDKsWindowsv7.1Libmscoree.lib
C:Program FilesMicrosoft SDKsWindowsv7.1Libx64mscoree.lib

0

Well, I’ve been trying to make a C++ DLL in Visual Studio 2015, which took a while since I’m not very good with Visual Studio.

I need to access the .NET libraries, specifically System::Management. (Writing the code was a little harder than it needed to be due to a poor C++ implementation, but at least it has one.)

I fixed obvious errors and finally figured out I had to enable CLR in the project properties and then select the related libraries with References->Add Reference. But after all that, now it’s just giving this weird error:

LNK1104: cannot open file 'MSCOREE.lib'

The compiler doesn’t show red wavy lines below anything, and the error claims the line is «1» and the file is «LINK», so no help there.

I thought I probably messed up the project configuration somewhere, so I created a new project and moved the code over. The error still happened. If I turned off CLR and commented out the .NET-dependent code, the build succeeded without errors.

So I tried creating a new project from template (Visual C++ -> Win32 Console Application) and then enabling CLR before doing anything else. Then I tried again, selecting different versions of .NET framework.

Finally, I tried creating a project with template (Visual C++ -> CLR -> CLR Console Application) and building it immediately. I mean literally without doing ANYTHING ELSE. It still gave the same error!

LNK1104: cannot open file 'MSCOREE.lib'

What on earth is going on? Am I doing something wrong here, or is VS2015 just broken?

  • Remove From My Forums
  • Question

  • Hi,

    I have upgrade the window application from vs 2008 to vs 2013 after upgradation, when i m trying to build madelineDll I am getting  this error LNK1104: cannot open file ‘MSCOREE.lib’
    MadelineDLL

    Can someone help me to resolve this ASAp.

    Thanks in advance

    Archana K.

    • Moved by
      Fred Bao
      Wednesday, April 29, 2015 6:37 AM
      C++ Or Visual Studio
    • Moved by
      Dave PatrickMVP
      Wednesday, April 29, 2015 9:35 AM

All replies

  • Hello archana,

    From your description, this exception seems to be related with the C++, if so, i suggest you could post this issue to the C++ forum and i notice that this issue is caused by the upgradation of Visual Studio, you could aslo ask it on the Visual
    Studio forum to confirm if the VS2013 has some changes compared with VS2008. I move it to the where the forum for, there are forum experts would help redirect it to a proper forum.

    The current forum you posted to is for .NET class libraries.

    Regards


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.

    Click
    HERE to participate the survey.

  • It’s because that the MSCOREE.lib changed its position, it should be under %PROGRAMFILES%Microsoft SDKsWindowsversionLib. You need add this path to Additional Library Directories. (You can check

    Cannot Open File MSCOREE.lib for more details)

    • Proposed as answer by
      Scot Br — MSFTMicrosoft employee
      Monday, June 22, 2015 10:20 PM
    • Edited by
      gbstack
      Tuesday, May 9, 2017 3:56 AM
      Update dead link

See more:

LINK : fatal error LNK1104: cannot open file ‘MSCOREE.lib’

On my machine,
mscoree.lib doesn’t locate in C:Program FilesMicrosoft SDKsWindowsv6.0ALib
It is located in C:Program FilesMicrosoft SDKsWindowsv5.0LibIA64
I’ve already add under
Tools->Option->Projects and solution->VC Directories

Please Help me:confused:


I just checked my system and it is in C:Program FilesMicrosoft SDKsWindowsv6.0ALib. Maybe your system has been corrupted somehow.

I just solved this by adding the library folder of windows SDK (...libx64) in the linker property : Additional Libary Directories (Project => Properties => Linker => Additional Libary Directories)

Regards,
Tennirva

add this code #pragma comment(lib, «MSCOREE.lib»)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject,
20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8
+1 (416) 849-8900

See more:

LINK : fatal error LNK1104: cannot open file ‘MSCOREE.lib’

On my machine,
mscoree.lib doesn’t locate in C:Program FilesMicrosoft SDKsWindowsv6.0ALib
It is located in C:Program FilesMicrosoft SDKsWindowsv5.0LibIA64
I’ve already add under
Tools->Option->Projects and solution->VC Directories

Please Help me:confused:


I just checked my system and it is in C:Program FilesMicrosoft SDKsWindowsv6.0ALib. Maybe your system has been corrupted somehow.

I just solved this by adding the library folder of windows SDK (...libx64) in the linker property : Additional Libary Directories (Project => Properties => Linker => Additional Libary Directories)

Regards,
Tennirva

add this code #pragma comment(lib, «MSCOREE.lib»)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject,
20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8
+1 (416) 849-8900

  • Remove From My Forums
  • Question

  • When I attempt to build an app using Visual Studio .Net 2008 beta I get the following error.

    1>LINK : fatal error LNK1104: cannot open file ‘MSCOREE.lib’

    Can anybody help?

    -Roberto

All replies

  • I am having the same problem.  I searched and found this post.  Have you found out what could be causing the issue by chance?

    Thanks,

  • I found this post and struggled with this for a while.  I asked a friend that works on the Microsoft Visual Studio team and he gave me the right answer.  I hope this helps others who find it:

    MSCOREE.lib was moved for Visual Studio 2008.  It now resides here:

    C:Program FilesMicrosoft SDKsWindowsv6.0ALib
    C:Program FilesMicrosoft SDKsWindowsv6.0ALibx64

    Add it to your library paths in VS 2008 (Tools/Options/Projects and Solution/VC++ Directories/Win32 or x64/Libraries).  Here Where Win32 and x64 are the target selected in the upper left corner of the dialog box.

    Now the library should be located properly.

    • Proposed as answer by

      Thursday, October 1, 2009 7:20 AM

0 / 0 / 0

Регистрация: 25.10.2022

Сообщений: 1

1

25.10.2022, 14:01. Показов 1746. Ответов 1


При запуске программы вылазит шибка lnk1104 не удается открыть файл «mscoree.lib», что делать ?

__________________
Помощь в написании контрольных, курсовых и дипломных работ, диссертаций здесь

0

Вездепух

Эксперт CЭксперт С++

10420 / 5692 / 1550

Регистрация: 18.10.2014

Сообщений: 14,018

25.10.2022, 19:45

2

Цитата
Сообщение от Дима 228
Посмотреть сообщение

При запуске программы вылазит шибка lnk1104 не удается открыть файл «mscoree.lib», что делать ?

Вы что-то выдумываете. Такой ошибки не может быть при запуске программы.

Это выглядит как ошибка, которая была получена при компиляции (сборке), а не при запуске. Раз пишет, что не удается открыть файл «mscoree.lib», значит так и есть. Очевидно, «mscoree.lib» используется вашей программой, но его нет в наличии.

0

See more:

LINK : fatal error LNK1104: cannot open file ‘MSCOREE.lib’

On my machine,
mscoree.lib doesn’t locate in C:Program FilesMicrosoft SDKsWindowsv6.0ALib
It is located in C:Program FilesMicrosoft SDKsWindowsv5.0LibIA64
I’ve already add under
Tools->Option->Projects and solution->VC Directories

Please Help me:confused:


I just checked my system and it is in C:Program FilesMicrosoft SDKsWindowsv6.0ALib. Maybe your system has been corrupted somehow.

I just solved this by adding the library folder of windows SDK (...libx64) in the linker property : Additional Libary Directories (Project => Properties => Linker => Additional Libary Directories)

Regards,
Tennirva

add this code #pragma comment(lib, «MSCOREE.lib»)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject,
20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8
+1 (416) 849-8900

So far, we know the following from an investigation of a similar report:

There appears to be an issue with the Windows 10 SDK version 10.0.17763.0 installed on the build agents. This may be an issue with 10.0.17763.0 generally, 10.0.17763.0 in combination with another version installed simultaneously, or only with the specific installation on the build agents; either way, attempting to use Windows 10 SDK 10.0.17763.0 produces failed builds on the agents when C++/CLI is involved.

When we changed a test project that was producing similar build failures (failing to find MSCOREE.lib in the linking phase) to use the latest version of the Windows 10 SDK on agent version 20200116.1, it detected version 10.0.18362.0 instead and the build succeeded. Therefore, if you are able to control which version of the Windows 10 SDK your code links against, please choose «Use Latest» or at least avoid version 10.0.17763.0 for now.

We’ll work on finding a better explanation and solution in the meantime.

RRS feed

  • Remove From My Forums
  • Question

  • When I attempt to build an app using Visual Studio .Net 2008 beta I get the following error.

    1>LINK : fatal error LNK1104: cannot open file ‘MSCOREE.lib’

    Can anybody help?

    -Roberto

All replies

  • I am having the same problem.  I searched and found this post.  Have you found out what could be causing the issue by chance?

    Thanks,

  • I found this post and struggled with this for a while.  I asked a friend that works on the Microsoft Visual Studio team and he gave me the right answer.  I hope this helps others who find it:

    MSCOREE.lib was moved for Visual Studio 2008.  It now resides here:

    C:Program FilesMicrosoft SDKsWindowsv6.0ALib
    C:Program FilesMicrosoft SDKsWindowsv6.0ALibx64

    Add it to your library paths in VS 2008 (Tools/Options/Projects and Solution/VC++ Directories/Win32 or x64/Libraries).  Here Where Win32 and x64 are the target selected in the upper left corner of the dialog box.

    Now the library should be located properly.

    • Proposed as answer by

      Thursday, October 1, 2009 7:20 AM

  • Ошибка lma хонда инсайт
  • Ошибка lll смад bplab
  • Ошибка lll на терморегуляторе
  • Ошибка livekernelevent код 1cc
  • Ошибка livekernelevent код 193