Click here to Skip to main content
15,920,005 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I don't understand why is using libraries in c++ so much more complicated than in c#, and if I am making a mistake by having so many folders like (/lib, /include, /LICENCE.txt ...)

What I have tried:

I am currently using cmake to build and install libraries than makes it much hard to manage projects and dependencies
Posted
Updated 13-Dec-20 22:33pm
Comments
Richard MacCutchan 13-Dec-20 15:04pm    
All systems are similarly complex. You just need to learn the rules.
Member 15019969 13-Dec-20 15:10pm    
hey Richard, so why do I need to create so many files in a c++ project and not in a c# project
Richard MacCutchan 13-Dec-20 15:43pm    
You don't.
[no name] 13-Dec-20 15:39pm    
*lol* my experience is that in c++ I have in average about 20 dll while in c# it is at least factor 10 more git this and git that. Don't take this too serious ;)
Richard MacCutchan 13-Dec-20 15:45pm    
"git this and git that"
In idiomatic English that is quite funny. :))

They aren't.
The basics of the .NET framework are in one library and that is required by all installations and are installed once per machine (unless you have multiple versions on .NET installed)

After that, users can add DLL files as necessary and they will be installed when the app is.

C++ doesn't do that because it uses a library system that isn't all installed - it's only added with the app when that is installed - so you only add the libraries you need to use to save space.
Unless you create a CLR C++ app, in which case it's the same as C#, with optional extra libraries.

Plus, you have to remember that C++ is based on C, and it's heritage shows in the library design. In theory, C++ apps can use any old C library (in practice, not a hope in hell - some of 'em are 16 bit, never mind trying to get a 32bit library working with a 64 bit EXE file!)
 
Share this answer
 
Comments
[no name] 13-Dec-20 15:43pm    
The basics of the .NET framework are in one library
Really ?
OriginalGriff 13-Dec-20 16:18pm    
A massive oversimplification: "lies to children" again! :laugh:
.NET creates the illusion of a container where "everything exists" ... the FrameWork [^],

A specific design goal of .NET and the GAC (Global Assembly Cache) was to eliminate "dll hell" caused by the need to explicitly manipulate DDL code libraries as their versions/facilities changed [^].

Under the illusion are many millions of lines of code, and tons of files :)
 
Share this answer
 

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