Another pro to Dynamic Libraries is that they are Shared Libraries. If you have 80 different applications that depend on the dynamic library, they all call the same DLL at run time. They are SHARING the library. You do not have duplication of the library's code, and each executable only contains it's own code. This is why Dynamic Libraries are called Shared Libraries.
@AndreiSokolov-k7j9 ай бұрын
thank you master
@belloemmanuel93992 жыл бұрын
You might've done this 6 years ago, but this is so well explained. You've just earned one more subscriber.
@dhyey231611 ай бұрын
Hands down best explanation of static and shared libraries. I much needed this video as I was struggling to understand this concepts.
@takumab3488 жыл бұрын
Keep making the tech videos for noob like me. much appreciated
@ehabnasr69255 жыл бұрын
+1 noob
@RemiStardust8 жыл бұрын
You making this specific video is a good example of why the internet is so great! Thank you, glad you decided to talk about this. I've seen .dll files many times over the years, never knew (nor was curious to know) what they were.
@armaandhanji21127 жыл бұрын
Hey Dave, I hope you can keep making these tech videos. I played this video during one of my college's C# classes, and everyone in the class loved it. Hope you can keep making more, they're super useful and will make for a wonderful reference in the future to come back to!
@DaveXiang7 жыл бұрын
Nice! haha wow that's cool. Yea, I haven't made a technical video in awhile, I'll have to make one
@ujjwalbansal10702 жыл бұрын
Just to sum up using code: file.c #include int main(){ printf("Hello"); } If we compile this file using gcc then there are two ways either we use shared library to include printf() functionality or we use static library which include whole other bunch of function along with pritnf() which make our executable heavy... Simplely compile your above program in two ways: gcc -o output file.c gcc -o output2 -static file1.c And check the size of output and output2. Since output2 is statically compiled it size is greater then output file.
@chriswaggoner46917 жыл бұрын
0:09 my 2¢: don't worry too much about "doing well" with likes/views. Online approval can be misleading. This is a quality topic
@jsnmad3 жыл бұрын
Your explanation about compile time versus run time loading of static library and shared library, respectively, was good.
@pascalmathias9336 Жыл бұрын
I love how much easy you made understanding this concept. God bless you
@NoleoTheDog2 жыл бұрын
Dave! You should keep making the tech videos. The simplicity of your explanation is splendid.
@kariwattsup3 жыл бұрын
As a typical highly interested in the why of stuff. I was looking in my systems and was like ..shared storage my ass... then I cancel the clear data . I came to this and wow. You do really great at teaching. I am not in this field of expertise but l can say this...I understand a whole lot more about my phone now. You guys use us being connected so we help give strength to the core of this huge web of shared storage...interesting. That's kind of cool . what programming or developing... I think this was a good video. Dont ever give up or not do your desire. Tech is in need of your communication style. Keep up on this stuff.
@vivekpal75598 жыл бұрын
Real good stuff! Feels good to get the feel of how things work under the hood in general. Keep more such videos coming!
@JohannaLu6 жыл бұрын
I started watching your videos on sunday morning, when I was hungover ... that day changed my life... 😊
@JamesGaehring8 жыл бұрын
I'm not learning any C-like languages (yet), but this helped me better understand what's going on when I have dependency issues of any sort, whether it's managing language versions, getting frameworks up and running, linux stuff, etc. This also clarified some differences between "compile-time" and "runtime". Thx!
@DaveXiang8 жыл бұрын
+James Gaehring glad it was helpful! thx
@memoryzulu78902 жыл бұрын
Great video. I now understand static and shared libraries more vividly. Thank you.
@vidhivadher90763 жыл бұрын
Extremely thankful to you Dave!!...You explained such a complex things in such an easygoing way..keep making the tech videos🔥
@belloemmanuel93992 жыл бұрын
I agree
@OnurTola10 ай бұрын
You explained this topic beautifully, very clear and precise. Thanks Dave.
@MsJavaWolf7 жыл бұрын
Man, don't care too much about views for any given video. Technical videos are much appreciated and you help a lot of people.
@twisted61482 жыл бұрын
So who told you your videos on tech are shitty? This is the information I've spent close to 72 hours sourcing for. Great job!
@sjsoulute79532 жыл бұрын
This is the best explanation ive come across so far. Thanks!
@BODAPATISASIKANTHnullRA4 жыл бұрын
You have a really good accent. Simple and strait forward, Keep making tech videos for us! lol!!
@paintingmylifeawaify7 жыл бұрын
Subscribed! You are better at explaining these concepts than any professor I've ever had.
@taylorz78758 ай бұрын
you are so good at explaining things!thanks Dave
@erickalmaraz21023 ай бұрын
A very illuminating/intuitive explanation. Thanks!
@puremoth8 жыл бұрын
David, Im extremely grateful for what youre doing here for the newbie community. im about to undergo a web app development curriculum that stresses a slow path.. and their language of choice to teach is Ruby. do you have any opinions about Ruby as a first language?
@DaveXiang8 жыл бұрын
Ruby is a good first language for sure. Easy to write, easy to understand. Also, very popular with web programming.
@saadelmaaqili4051 Жыл бұрын
Hello , I know it's been 7 YEARS, but in the Event that you see this, how did that curriculum workout for you?
@presbytes8 жыл бұрын
Keep making the tech vids. We love it
@damienw49585 жыл бұрын
I use static libraries when there is less duplicated code to not worry about run time dependencies, but if I have some code that most of the rest of my project(s) need, I bung it in a shared library.
@lemontheme316 жыл бұрын
Really dig your style of explanation. So calm and measured. I understood all of it. Thanks!
@johneric2720 Жыл бұрын
I really love this video! Detailed explanation, you broke things down to the core. Thank you very much😃, I really enjoyed it👍
@lilcannedpeach4 жыл бұрын
10 minutes well spent thanks buddy
@marcuswilson12306 жыл бұрын
dave Xiang is the man!!!! your videos are helping
@ltecheroffical Жыл бұрын
This video is 7 years old and it aged so well even now
@cid0070074 жыл бұрын
Learnt great stuff from your video that I was not able to answer in one of my interview and failed.. Thanks alot for such kind of stuff :)
@randomsoul00 Жыл бұрын
by mean "reference" Do you mean it goes to an actual implementation of that function like printf whenever it is needed instead of copying it in our executable
@jadsayegh62837 жыл бұрын
Thanks for making this, very useful. We need more fundamentals like this
@andrewjoe18363 жыл бұрын
Thank you for this video, you explained chapter 1 of my linux+ book very well!
@wadejbeckett4 жыл бұрын
Thank you! This is a great supplementary video to LFS201.
@isaacphiri61873 жыл бұрын
Very good and simple explanation. Easy to understand.
@deltashadow41546 жыл бұрын
Really good and simpler explanation. Thank you so much for this video. Subscribed !
@Skybuildhero7 жыл бұрын
It's a nice overview about these types of libraries, but you tend to repeat your structure sometimes.
@oscaralejandrobedoyaobando19556 жыл бұрын
Me caiste bien amigo. Explicas de una manera espectacular, seguire viendo todos tus videos. Gracias
@TenderBug5 жыл бұрын
Yeah Thank you, this is very concise explanation and cleared my doubts, which I didn't know to form a query to Google search.
@castel35644 жыл бұрын
Although I might be wrong, but actually there is small mistake in your explanation. All the executable code or implementation of functions in particular library (at least in case C and C++) lies in DLL files. Bit in static linking of library in time of compilation a .lib file is used to find a needed function in DLL file, while in dynamic linking the process differs and a .lib file is not needed. So .lib files are for the static linking, but the actual code of library are contained in dll file in both cases. Its info on WIki: en.wikipedia.org/wiki/Dynamic-link_library
@anandareddy49318 жыл бұрын
Outstanding Explanation Dave Xiang..
@logangraham29565 жыл бұрын
sounds like for smaller applications at least (that use few libraries) static libraries is the way to go unless its libraries that you can almost garantee is already something the end user is using anyways. printing to console would be a good shared. but a highly customized graphics library might be better off as static.
@doandzhi6 жыл бұрын
Great video man, brilliant tone and explanation flow.
@janaro787 ай бұрын
Great way of explaining it, thanks for video!
@RaffaeleApetino6 жыл бұрын
This explanation was pretty much perfect. Thank you!
@MinecraftGamer1010108 жыл бұрын
Thanks for the video, it's very educational! I also laughed a little when you told us about how you messed with some of the .dll files on your computer can bricked it as I also did that when I was a kid (was my first time seeing a blue screen).
@HarishN248 жыл бұрын
Thanks for the great videos. Your videos gave a clear picture of what's going on under the hood.. Can you please make a video on how linkers work, what are relocatable object codes and some info on symbol table in context of C program compilation.
@rajcodes1005 жыл бұрын
Thanks Dave Xiang - very good explanation .
@brianmanden8 жыл бұрын
Thank you for another great video Dave. Keep´em coming :)
@rajcodes1005 жыл бұрын
Thanks Very much for this talk on libraries - you have touched on some cool points.
@andreacacioli26124 жыл бұрын
You explain things very well!
@DanielShamany7 жыл бұрын
Can you make a video on how to link to the boost library, and perhaps how to use CMake in the terminal to do all that?
@dfhayak3 жыл бұрын
Thank you for explaining this so well.
@simpleblossom74414 жыл бұрын
this has helped me so much! thank you! really appreciate it.
@tejeshB197 жыл бұрын
awesomeness ... 👌👌👌👌 please continue making these tech videos... I'm finally understanding coding ..... thanks a lot !! please do complete tutorials on c# ....
@sidduvenkateswararao79963 жыл бұрын
Would you care to explain which would be convenient in the debugging perspective. In my immediate thought debugging with shared libs must be very hard compared static libs
@androidlg73116 жыл бұрын
Can you do both? Make a project with some shared libraries and some static?
@praveenrathode36577 жыл бұрын
I an Indian ....Liked the way you explained ...Really Awesome explanation...Thank you so Much
@kudoamv6 жыл бұрын
My friend is an Indian too , but he knows Grammar. . . . *No offence intended to anybody*
@Impulse_Photography5 жыл бұрын
I finally found you - - This is really good
@ameyaupasani7208 жыл бұрын
excellent tutorials....i just love it...keep it up
@wobble_cat4 жыл бұрын
The biggest benefit of shared libraries is that you can share them across multiple projects
@user-og6ol2im7v7 жыл бұрын
Very well explained. Thanks a lot!
@devanshuvedios7 жыл бұрын
Very nice video.. Tech videos rock!
@v-ba Жыл бұрын
Cool explanation, thank you very much!
@roberthensley71304 жыл бұрын
great conceptual explanation of it!
@meetparikh80427 жыл бұрын
yes ! for me very helpful and understandable video.. thank you for sharing ...
@ArunKumar-qo6zt4 жыл бұрын
Thank you so much for the introduction.
@leegaines23917 жыл бұрын
You explained that very well. Thanks!
@nawaryoussef8 жыл бұрын
Thanks man, keep up the good work!
@ankishamathur26256 жыл бұрын
keep making tech videos :) & thanks for helping me
@henryunah65436 жыл бұрын
what is the difference between libraries and header files
@logangraham29565 жыл бұрын
im pretty sure they are the same thing. it just has to due with the programming langauge in question. the c family of programing langauges use "headers" with the extension ".h" as far as i know there is no other difference other then what its called
@logangraham29565 жыл бұрын
pretty sure they are considered static because everything is copied over into the executable on compilation. so ya header files are just very specific static library files for the C family of programming languages :)
@Yhigma8 жыл бұрын
I REALLY like the tech videos.
@seyhangul19 ай бұрын
Excellent explanation.
@aver803bath2615 жыл бұрын
Great explanation. Thanks for sharing!
@dadsggx563 жыл бұрын
really solid explanation!
@dogactekman22888 жыл бұрын
thank you so much for those explanations. subbed!!!
@ramvallabhsingh35186 жыл бұрын
very well explained, thank you very much.
@drishtidhamejani66096 жыл бұрын
Subscribed after this
@ravishankar38857 жыл бұрын
how can I create my own library? BTW, thanks for such a deep knowledge.
@carloslvm8 жыл бұрын
Awesome, Do you know any book that explains libraries in details? I'm learning programming and I find this topic very confusing.
@34521ful7 жыл бұрын
Hey Dave, great video! I had a quick question. In C, when you do #Include to get the printf function, would this be "static" since the preprocessor does a literal copy and paste of that entire stdio.h file on top of my other source code? if so, what would be an example of dynamic linking? Thanks again!
@DaveXiang7 жыл бұрын
when you do the #include you get a copy and paste of the header file. you still need to link w/ the implementations. you have a choice of dynamic vs static even for standard library just as you would custom library. most often, depending on OS and compiler defaults, the standard libraries will be a shared lib on the system somewhere. Like a library like... /lib/libc.so (something like that) Don't quote me on that, but you'll have the option of doing both. If you really want, you can also statically link contents from the standard lib into your executable.
@FollowTheLeeD4 жыл бұрын
Super helpful. Thanks man!
@mr.shredder543011 ай бұрын
may i ask an out of topic content, does a desktop software need a database?
@luciocardoso63068 жыл бұрын
+Dave Xiang I've recently discovered you channel, and I think it's one of the best of its genre. Thanks a lot for all the knowledge! I would really like if you could answer one question I have: I'm currently learning C (as a first language) on Linux, and I'm reading Stephen Prata's C primer plus. Should I continue reading it, or do you recommend me another book/course?
@DaveXiang8 жыл бұрын
+Lucio Cardoso Nice! C is an ambitious language to learn first but should be fruitful once you understand it. I don't know about that book personally, but just make sure you can differentiate from a "reference" style vs "curriculum" style book. I would get one for each. A curriculum you can easily follow, and a reference which you can index for specifics.
@Nicxlive5 жыл бұрын
Great Video!!! Thank you, keep on please
@johnernest81097 жыл бұрын
Great tech video Dave, I just wanted to give some feedback and a few questions. Static vs Shared definitely necessitates this kind of discussion. I'm in the middle of it trying to compile Meka, a Sega Master System emulator, from Git with Allegro 5.2, ZLib, LibPNG, FreeType, and other extensions like OpenAL if I want to specify them in the Allegro build. So these are my questions: 1) Sure the app size with DLLs are smaller, but isn't the file size just shifted from the app to the DLL? In that case having one DLL systemwide say in \Windows\System32 is ok, but having the same DLL all over your HDD would needlessly bog down your system. 2) Is there a benefit other than file size of the app to be gained from using Static Libraries? In some of the projects I see ZLib for example being used as a Static Library, and I'm not sure why they don't all just use DLLs everywhere. Why do some coders seem to prefer them over Dynamic? Are there other benefits to using Static Libraries such as performance? Also of a side note, in the above scenario I can't seem to find a way yet to get Visual Studio 2015 to build Allegro as static libraries, when I tried manually with the built projects from cmake-gui I ran into lots of errors. 3) When linking in a Static Library, are only the methods used copied into the application, or is the whole library used? Are multiple copies of the same class/methods copied into the end product, or just a single reference? e.g. If I have a "void Shape::Draw(void)" method that's called many times throughout an app is a copy made for each reference to the function, or just copied once?
@DaveXiang7 жыл бұрын
Hey, thanks for the message, let me try to answer 1) DLL's are usually shared in 1, or a few, central locations on your computer. They won't be scattered over your file system. The whole point is that they are centralized and many other executables can all use them. There won't be a case where a shared library is "scattered" over the system unless you do it on purpose to mess around. 2) You gain portability. With a static library that may depend on very few shared libraries, you can pretty much "drag and drop" and it will work. For shared libraries, you have to take extra care to make sure it runs properly. 1 mis matched shared library could cause executables to not work across different systems. Static libraries can safe some headache 3) Only what it needs
@user-or7ji5hv8y5 жыл бұрын
Where can we find your video on Linking?
@firedragonmangaming24102 жыл бұрын
Great video, i understand clearly
@soiralknarf8 жыл бұрын
Is it possible to use functions from a shared library and add them in at compile time or would you have to just download a similar static library and just use that?
@DaveXiang8 жыл бұрын
+soiralknarf You'll need a static version of the library.
@davidFbeckham5 жыл бұрын
Great explanation man, thank you
@G33KN3rd7 жыл бұрын
interesting vid Dave. I'm making a C interpreter as an embeddable scripting engine (C as a scripting language! lol) and I have no idea whether I should have the interpreter built as a static or a shared library so I opted for both! Should I just have it static, shared, or keep both in the case someone wants it as either shared or static? My interpreter is pretty small (50-80Kb). looking at the static library of it now, it's only 50Kb, same thing for the shared library file.
@DaveXiang7 жыл бұрын
Either or works, or you can just provide the source code so people can build it however they want!
@G33KN3rd7 жыл бұрын
I could but the interpreter isn't 100% practical to use yet (it still needs a compiler that generates code for its VM). It is USEABLE but not practical (yet). Anyway, source code is on github -> github.com/assyrianic/Tagha-Virtual-Machine
@user-or7ji5hv8y5 жыл бұрын
that was a very good explanation.
@abdoulrachidayouba45508 жыл бұрын
thank you man.what are the advices you can give a c.s student concentrating on software engineering.
@DaveXiang8 жыл бұрын
+Abdoul Rachid Ayouba dont worry about learning all the latest and greatest languages and frameworks. focus all your energy on understanding how computers work and how software works.
@abdoulrachidayouba45508 жыл бұрын
thank you Dave Xiang.but i guess learning languages is the best way to know how software works.
@balaganesh34404 жыл бұрын
dang! that's a headshot of explanation!
@Vineeth_Shankar4 жыл бұрын
How do we decide when to use static or shared libraries?
@DaveXiang4 жыл бұрын
They both have pros and cons. Static is more portable but if your program is small, it may be alright. Shared libraries prevent your executables from getting too large and may be crucial for complicated applications.