How to write your own code libraries in C.

preview_player
Показать описание
---

.



***

Welcome! I post videos that help you learn to program and become a more confident software developer. I cover beginner-to-advanced systems topics ranging from network programming, threads, processes, operating systems, embedded systems and others. My goal is to help you get under-the-hood and better understand how computers work and how you can use them to become stronger students and more capable professional developers.

About me: I'm a computer scientist, electrical engineer, researcher, and teacher. I specialize in embedded systems, mobile computing, sensor networks, and the Internet of Things. I teach systems and networking courses at Clemson University, where I also lead the PERSIST research lab.

More about me and what I do:

To Support the Channel:
+ like, subscribe, spread the word

Want me to review your code?

You can also find more info about code reviews here.
Рекомендации по теме
Комментарии
Автор

this video saved an intern who's new to the cross compilation world.

mr
Автор

Kids these days have it so easy. 20+ years ago if you lived in the middle of nowhere you'd be lucky to find a compiler on floppies, then never find compatible books. It took software piracy and haggling with an alcoholic college dropout living in a camper to score a copy of Borland Turbo C v2.04 AND a highly used copy of Waite Group's Turbo C Programming for the PC by Robert Lafore... That book never stopped smelling like a tool shed.

Your short C vids are fantastic! Especially ones on more complex topics.

boxedowl
Автор

This is brilliant, thank you. Would be a nice intro to a larger video on dynamic code loading at runtime.

karlforshaw
Автор

4:13Thank you, this is something that I don't think is explained in many tutorials for setting up dynamic link libraries and was very confusing for me.

danieleccleston
Автор

Excellent videos on the channel, and this one is no different. I think of them as similar to the process of making a fine espresso coffee. A lot of knowledge is condensed into well structured, rich and concise information. But not just that, well produced and even entertaining. This is the gold standard of howto programming videos

prospermatkovic
Автор

I literally had to pause the video to comment. Thank you Sir Jacob for educating the masses with such sheer brilliance!

ammartirmizi
Автор

Dude 🙏 this has been so informative, can express enough how grateful I am. Not only have I learned a bunch about creating libraries, I also learned a bit more about using makefiles. I use gcc and was relieved that I didn’t have to change anything.

Again, much thanks.

arthur_p_dent
Автор

Note that in your header your include guard starts with two underscores, and I believe that violates the C standard as those are reserved

thezeegamingc
Автор

A lot of that information went right over my head. That was very fast for an AP CSP student, who just started using C in August.

jeremiahyonemura
Автор

Thank you very much for these great tutorials! Very useful and good explained.
I have one annotation to your code: The identifier __MY_CODE_H__ of your "include guard" may clash with identifiers of the compiler implementation. (For this identifier it is unlikely.) The C standards specify that certain identifiers are reserverd for the implementation, particularly those with two underscores. So, you may better want to use just MY_CODE_H for this purpose.

michaelkotthaus
Автор

Me: Tons of information in 10 minutes?
Jocob: YES! Damn it..

vb
Автор

three months ago, this video would have saved me some hours!

can you do a video about dynamically linked libraries?

benjaminshinar
Автор

4:08 Why is "-l<name>" needed during build time? Doesn't that beat the whole purpose of shared libraries? Why not just use static libraries if both need to be present at build time. I would expect to be able to build my main program without specifying ANYTHING about the shared library, otherwise it's not really dynamic.

tothespace
Автор

Thank you for this vid! I immediately spotted what I was doing wrong (not #including my header file in my library source file).

bettyswunghole
Автор

I was calling my library header.a, and I wasted hours trying to make the linker find it, that was until you mentioned the lib- as (libheader) detail, thanks!

koobe
Автор

Heyyy, you should try to make a video on how to make your own data structures or the thought process behind it. That would be super cool

edgar
Автор

in windows cmd, type "set _env_name = "_path_" "for setting temperorarily setting environment variable.
for permanent setting use "setx" instead of "set"

sudarshanv
Автор

The searchpath for the runtime liker can be mangled during compilation as well.

You basically have to link your executable like this (untested):

gcc -o bin *.o -Wl, --rpath="$ORIGIN"

This will make the runtime linker look in the same directory as the executable (this behavior is as far as I remember default on windows).

sghsghdk
Автор

Your videos are awsome. straight to the point.

jesvinjohnson
Автор

Very helpful. I knew how to do this stuff with Visual Studio on Windows, but there wasn't a whole lot of stuff about how to do this stuff in Linux.

coolbrotherf