Tools, FAQ, Tutorials:
Error on Building C++/CLI Programs
Why I am getting "LNK1104: cannot open file 'MSCOREE.lib'" error when building a C++/CLI program?
✍: FYIcenter.com
Visual C++ supports the C++/CLI (Common Language Infrastructure) programming language, which has additional types and operators to target the .NET programming model. It is done by using the CLR (Common Language Runtime) from the .NET Framework.
This tutorial shows you how to use a text editor to create a basic C++/CLI program, then compile and link it on the command line.
1. Enter the C++/CLI program, HelloCLI.cpp with a text editor:
// HelloCLI.cpp // Copyright (c) FYIcenter.com int main() { System::Console::WriteLine("Hello World! - From C++/CLI."); }
2. Run "All Programs > Visual Studio 2017 > Visual Studio Tools > Developer Command Prompt for VS 2017". You see the Visual Studio Command Prompt window.
3. Compile and link the C++/CLI program, HelloCLI.cpp, with the "/clr" (Common Language Runtime) option:
C:\fyicenter>cl /clr HelloCLI.cpp Microsoft (R) C/C++ Optimizing Compiler Version 19.10.25019 for Microsoft (R) .NET Framework version 4.06.1055.0 Copyright (C) Microsoft Corporation. All rights reserved. HelloCLI.cpp Microsoft (R) Incremental Linker Version 14.10.25019.0 Copyright (C) Microsoft Corporation. All rights reserved. /out:HelloCLI.exe HelloCLI.obj LINK : fatal error LNK1104: cannot open file 'MSCOREE.lib'
You are getting this error, because the C++/CLI Support component is missing Visual Studio. See the next tutorial on how to install it.
⇒ Install C++/CLI Support with Visual Studio Installer
⇐ "MyLibApp.cpp" - Call C++ Class from Static Library
2023-06-19, 2509🔥, 0💬
Popular Posts:
How to create Hello-3.1.epub with WinRAR? I have all required files to create Hello-3.1.epub. To cre...
Where to find tutorials on Using Azure API Management Publisher Dashboard? Here is a list of tutoria...
Can Two Forms Be Nested? Can two forms be nested? The answer is no and yes: No. You can not nest two...
What is Azure API Management Publisher Dashboard? Azure API Management Publisher Dashboard is an Azu...
Why am I getting this "Docker failed to initialize" error? After installing the latest version of Do...