i was wondering how programs like ccleaner and utorrent are made? AFAIK they are written in C++ but they run without the need of .net framework and apparently run on windows 98 as well. How can this be done? Visual c++ requires .net framework to be installed to run the binary file.
我想知道ccleaner和utorrent这些程序是如何制作的?虽然它们是用c++编写的,但是它们不需要.net框架就可以运行,而且显然也可以在windows 98上运行。怎么做呢?Visual c++需要安装。net框架来运行二进制文件。
While .net framework is free, it can be a hassle and it would probably turn many users away as the setup is 20MB+ and installs several files/registry entries.
虽然。net框架是免费的,但它可能是一个麻烦,它可能会让许多用户离开,因为设置是20MB+并且安装几个文件/注册表项。
5 个解决方案
#1
15
Visual c++ requires .net framework to be installed to run the binary file.
Visual c++需要安装。net框架来运行二进制文件。
No, it does not. In fact, C++ and the .NET framework are highly unrelated. You only need the .NET framework if your application is written in C++/CLI, which is far away from regular C++.
不,它不。事实上,c++和。net框架是高度不相关的。如果您的应用程序是用c++ /CLI编写的,那么您只需要. net框架,这与普通的c++相去甚远。
If you develop an application in standard C++, you don't need the .NET framework, just the runtime shipped with your toolchain (Visual C++, mingw, whatever). In some cases you can also link to the runtime statically, so you don't even need to distribute DLLs etc.
如果您在标准c++中开发了一个应用程序,那么您不需要. net框架,只是运行时附带了您的工具链(Visual c++, mingw,等等)。在某些情况下,您还可以静态地链接到运行时,因此您甚至不需要分发dll等。
As for creating GUIs in regular C++, there are toolkits out there. Microsoft offers the bare Windows API, MFC, WTL and there are 3rd party products, like Qt or wxWidgets
至于在常规c++中创建gui,有一些工具包。微软提供裸机Windows API、MFC、WTL,还有第三方产品,如Qt或wxWidgets
#2
4
Create native C++ project, without using CLI. In VC++ Application Wizard you can select any type, except of CLI.
创建本地c++项目,不使用CLI。在vc++应用程序向导中,除了CLI之外,您可以选择任何类型。
Native C++ project has its own runtime requirements: C/C++ runtime, MFC runtime (if MFC is used), but .NET Framework is not required.
本机c++项目有自己的运行时需求:C/ c++运行时、MFC运行时(如果使用MFC),但不需要. net框架。
#3
3
When creating the project, set it up as a Win32 project, not a CLR project. That will ensure that you're compiling against the C++ standard rather than the managed C++ variant used for .Net.
在创建项目时,将其设置为Win32项目,而不是CLR项目。这将确保您是针对c++标准进行编译,而不是针对. net使用的托管c++变体。
#4
2
It's important to understand the difference between native and managed code on Windows. There is basic discussion of that topic on SO here and a deeper dive from a Microsoft person here.
理解Windows上本机代码和托管代码之间的区别是很重要的。这里有关于这个主题的基本讨论,这里有一个微软人的深入介绍。
Your concern about taking a dependency on .Net Framework may be out of date - new PCs would have it installed by default since Vista and Windows 7 include it, and many older ones will have it due to existing .Net apps or via Automatic Update from Microsoft - there is some info on .Net version relative penetration rates here.
你将依赖于。net Framework的关注可能会过时,新电脑安装默认从Vista和Windows 7包含它,和许多旧将由于现有。net应用程序或通过自动更新从微软——有一些信息在。net版本相对渗透率。
That said, I would not choose C++/CLI unless you have native/managed code interop requirements - use C++ for native and C# for managed code.
也就是说,我不会选择c++ /CLI,除非您有本机/托管代码互操作需求——本机代码使用c++,托管代码使用c#。
#5
1
In my opinion .NET framework gives you only high production speed otherwise i hate it.
在我看来。net框架只能提供高的生产速度,否则我讨厌它。
Use .Net when:
使用。net时:
1 - You want speed production
1 -你想要快速生产
2 - You already program with a team that use .Net
2 -你已经和一个使用。net的团队一起编程了
3 - You want portability(only between windows and supporting systems)
3 -你想要可移植性(只有在windows和支持系统之间)
Use normal/native win32 programming when:
当:
1 - wants more freedom
1 -想要更多的*
2 - wants more control over the system and the program u write
想要对系统和程序有更多的控制
3 - have excess time
3 -有多余的时间
#1
15
Visual c++ requires .net framework to be installed to run the binary file.
Visual c++需要安装。net框架来运行二进制文件。
No, it does not. In fact, C++ and the .NET framework are highly unrelated. You only need the .NET framework if your application is written in C++/CLI, which is far away from regular C++.
不,它不。事实上,c++和。net框架是高度不相关的。如果您的应用程序是用c++ /CLI编写的,那么您只需要. net框架,这与普通的c++相去甚远。
If you develop an application in standard C++, you don't need the .NET framework, just the runtime shipped with your toolchain (Visual C++, mingw, whatever). In some cases you can also link to the runtime statically, so you don't even need to distribute DLLs etc.
如果您在标准c++中开发了一个应用程序,那么您不需要. net框架,只是运行时附带了您的工具链(Visual c++, mingw,等等)。在某些情况下,您还可以静态地链接到运行时,因此您甚至不需要分发dll等。
As for creating GUIs in regular C++, there are toolkits out there. Microsoft offers the bare Windows API, MFC, WTL and there are 3rd party products, like Qt or wxWidgets
至于在常规c++中创建gui,有一些工具包。微软提供裸机Windows API、MFC、WTL,还有第三方产品,如Qt或wxWidgets
#2
4
Create native C++ project, without using CLI. In VC++ Application Wizard you can select any type, except of CLI.
创建本地c++项目,不使用CLI。在vc++应用程序向导中,除了CLI之外,您可以选择任何类型。
Native C++ project has its own runtime requirements: C/C++ runtime, MFC runtime (if MFC is used), but .NET Framework is not required.
本机c++项目有自己的运行时需求:C/ c++运行时、MFC运行时(如果使用MFC),但不需要. net框架。
#3
3
When creating the project, set it up as a Win32 project, not a CLR project. That will ensure that you're compiling against the C++ standard rather than the managed C++ variant used for .Net.
在创建项目时,将其设置为Win32项目,而不是CLR项目。这将确保您是针对c++标准进行编译,而不是针对. net使用的托管c++变体。
#4
2
It's important to understand the difference between native and managed code on Windows. There is basic discussion of that topic on SO here and a deeper dive from a Microsoft person here.
理解Windows上本机代码和托管代码之间的区别是很重要的。这里有关于这个主题的基本讨论,这里有一个微软人的深入介绍。
Your concern about taking a dependency on .Net Framework may be out of date - new PCs would have it installed by default since Vista and Windows 7 include it, and many older ones will have it due to existing .Net apps or via Automatic Update from Microsoft - there is some info on .Net version relative penetration rates here.
你将依赖于。net Framework的关注可能会过时,新电脑安装默认从Vista和Windows 7包含它,和许多旧将由于现有。net应用程序或通过自动更新从微软——有一些信息在。net版本相对渗透率。
That said, I would not choose C++/CLI unless you have native/managed code interop requirements - use C++ for native and C# for managed code.
也就是说,我不会选择c++ /CLI,除非您有本机/托管代码互操作需求——本机代码使用c++,托管代码使用c#。
#5
1
In my opinion .NET framework gives you only high production speed otherwise i hate it.
在我看来。net框架只能提供高的生产速度,否则我讨厌它。
Use .Net when:
使用。net时:
1 - You want speed production
1 -你想要快速生产
2 - You already program with a team that use .Net
2 -你已经和一个使用。net的团队一起编程了
3 - You want portability(only between windows and supporting systems)
3 -你想要可移植性(只有在windows和支持系统之间)
Use normal/native win32 programming when:
当:
1 - wants more freedom
1 -想要更多的*
2 - wants more control over the system and the program u write
想要对系统和程序有更多的控制
3 - have excess time
3 -有多余的时间