How-To Create And Use A DLL (Dynamic Link Library) with C++ MSVC Visual Studio 2019 Walkthrough

  Рет қаралды 114,228

Code, Tech, and Tutorials

Code, Tech, and Tutorials

Күн бұрын

Пікірлер: 67
@behrampatel4872
@behrampatel4872 Ай бұрын
Excellent tutorial. The fundamentals here helped me understand a lot of what was going on with Unreal Engine and building plugins etc cheers 💯
@CodeTechandTutorials
@CodeTechandTutorials Ай бұрын
Thanks for the feedback, that's what I was hoping for!
@jevsdisjava
@jevsdisjava 3 жыл бұрын
it look like you are good at teaching those who already know.
@CodeTechandTutorials
@CodeTechandTutorials 3 жыл бұрын
I try
@klyper
@klyper 3 жыл бұрын
@@CodeTechandTutorials yo, not sure if homie was trying to burn u or not, but just for the record: THANK YOU for this video.
@KrisRay-j9d
@KrisRay-j9d 11 ай бұрын
Great video! Just an FYI, you can create a whole new solution by doing a "File->New->Project" and it'll take you straight to the "create project template" screen you get when you first start up MSVS and it'll create it as a completely separate Solution. Kudos to the video!
@muhammadshahpaal6325
@muhammadshahpaal6325 3 жыл бұрын
i did all the steps repeatedly correct watching your video, still its giving me error that "Cannot open file CompilerLibrary.lib" its my file name. i have made a dll project for that which includes the CompilerLibrary.h and .cpp implementation files
@yy-ll1uw
@yy-ll1uw 3 жыл бұрын
Completely off topic, but your voice is REALLY attractive.
@raulgalets
@raulgalets 4 ай бұрын
goated. just what I needed
@nameredacted1157
@nameredacted1157 8 ай бұрын
This was a huge help, thank you!
@berkerozbayar5072
@berkerozbayar5072 3 жыл бұрын
Hi. How can i copy code from github and make that thing to dll can you help me ?
@boom5935
@boom5935 2 жыл бұрын
Thanks, saddly i can't use Visual Studio, idk why, but it cannot compile not even a hello world program on it
@bestganesh
@bestganesh 4 жыл бұрын
Disappointed... Wanted to know how exactly DLL works with C++. :(
@CodeTechandTutorials
@CodeTechandTutorials 4 жыл бұрын
I could probably do a video just explaining that at some point, I guess I did sort of skip over it and went straight to business here.
@serg2104
@serg2104 3 жыл бұрын
a dll is used to create different libraries. yes, there are libraries like iostream and vector, but with dlls, you can add whatever you want. iostream is mainly used for the console (command prompt or terminal) but dlls can be used not only on c++ and it can be used to create apps or whatever. hope this helped i guess
@zeldaoot23
@zeldaoot23 Жыл бұрын
Weirdly, even though I specify the directory that contains the FibLibrary.h in the FibClient project's Include Directories, Visual Studio can't find the header file. Is there any reason this might be happening? I've checked the directory multiple times, and the FibLibrary.h file is present. Tried both relative path and absolute path, and still no dice. Should be extremely simple, so this is frustrating. EDIT: I solved the problem by closing the project, deleting the .vs directory from the FibClient project folder, and re-opening the FibClient project.
@galileogalilei725
@galileogalilei725 7 ай бұрын
when i type dinamic on visual studio doesnt find anything, i have no option
@rei1534
@rei1534 Жыл бұрын
☝One small note: my dll says it is 14 in the editor but this will cause problems after many releases. to fix this error you will have to change keyboard input to traditional chinese. It will allow your DLLs to become multi-continental and therefore better carbon footprint.
@Gerisk
@Gerisk 2 жыл бұрын
I can't find the dynamic link library; it's just not showing up for me.
@samdavepollard
@samdavepollard Жыл бұрын
Many Thanks. If I'm understanding correctly (not a given since I'm a noob) the Post Build macro thingy at the end copies the .dll for us, into the same folder as our .exe, but this means we end up with a copy of the .dll in each and every project. Is there some way we can tell Visual Studio where the .dlls files reside and have Visual Studio pass that info to the exe? (I know I can add the path to the .dlls to my Path environment variable, and that works fine, but just wondering if I can give VS an explicit link to the .dlls?) Thanks again.
@AaronLynch-g5y
@AaronLynch-g5y 9 ай бұрын
the post build doesn't work like that if the dll isn't found in the first directory you gave it'll activate the macro to look for it brings it over to your exe folder, as long as the dll remains where it is it won't copy it again, that's my understanding :/
@GokdenizCetin
@GokdenizCetin 11 ай бұрын
Thank you
@lukenukem8028
@lukenukem8028 4 жыл бұрын
You didn't link in your description the URLs.
@weluvmoonrock5026
@weluvmoonrock5026 4 жыл бұрын
I am very very stupid, I found a .dll file but I found the source as a Visual Studio file so i opened it up and changed one line of code what timestap would help me now export it as a .dll?
@harryshuman9637
@harryshuman9637 4 жыл бұрын
build it?
@Lippeth
@Lippeth 3 жыл бұрын
I can levitate birds but no one seems to care.
@noam190
@noam190 4 жыл бұрын
thanks a lot man
@jahamez6960
@jahamez6960 3 жыл бұрын
For some reason my visual studio doesnt have any templates.Can anyone help me?
@CodeTechandTutorials
@CodeTechandTutorials 3 жыл бұрын
You have probably deleted the folder that stores them.
@ducduong6328
@ducduong6328 Жыл бұрын
I can help you
@tzgardner
@tzgardner 2 жыл бұрын
3:00 If you are creating a dll library, why would you need the dllimport on line 7?
@velvethamster9809
@velvethamster9809 2 жыл бұрын
Dllimport is there because when you include header files to load a dll to your project, it will import the implementations of the header file you included in your project from the dll.
@lewitch09
@lewitch09 Жыл бұрын
Header File Code: // MathLibrary.h - Contains declarations of math functions #pragma once #ifdef MATHLIBRARY_EXPORTS #define MATHLIBRARY_API __declspec(dllexport) #else #define MATHLIBRARY_API __declspec(dllimport) #endif // The Fibonacci recurrence relation describes a sequence F // where F(n) is { n = 0, a // { n = 1, b // { n > 1, F(n-2) + F(n-1) // for some initial integral values a and b. // If the sequence is initialized F(0) = 1, F(1) = 1, // then this relation produces the well-known Fibonacci // sequence: 1, 1, 2, 3, 5, 8, 13, 21, 34, ... // Initialize a Fibonacci relation sequence // such that F(0) = a, F(1) = b. // This function must be called before any other function. extern "C" MATHLIBRARY_API void fibonacci_init( const unsigned long long a, const unsigned long long b); // Produce the next value in the sequence. // Returns true on success and updates current value and index; // false on overflow, leaves current value and index unchanged. extern "C" MATHLIBRARY_API bool fibonacci_next(); // Get the current value in the sequence. extern "C" MATHLIBRARY_API unsigned long long fibonacci_current(); // Get the position of the current value in the sequence. extern "C" MATHLIBRARY_API unsigned fibonacci_index();
@neweins8864
@neweins8864 2 жыл бұрын
I'm just seeing .dll but not .lib file in debug folder.
@matanvinkler71
@matanvinkler71 4 жыл бұрын
Do I need to do that every time I create a new project?
@TipsJazzInferno
@TipsJazzInferno 2 жыл бұрын
No
@Northous
@Northous 3 жыл бұрын
this guide did not work i did everything you said and did and i still send i was missing the lib file after i followed your step to correct the error and the folder file were correct smh
@davidpower635
@davidpower635 3 жыл бұрын
Thank you for this. You were very easy to follow and you walked through the MS documentation which was helpful. Don't be put off by they negative comments - there are a lot of ungrateful arseholes on the internet. I code in Excel VBA as it is very easy to do but when it comes to unwieldy calculations it falls down badly. C++ is very hard to get to grips with at first but, having learnt Pascal then C decades ago I can understand why. I started programming with machine language (ZX Spectrum) and we used to make up useful functions to speed up our programming. I seem to recollect that early C had this facility and I think that's how it originated. That was 40 years ago. Thank you once again.
@wanderingpalace
@wanderingpalace 3 жыл бұрын
vba sucks lmao
@ke3wik
@ke3wik 3 жыл бұрын
thank
@ryseran
@ryseran 2 жыл бұрын
Hey, what toolset do I need to install for .dll?
@zorfporf3078
@zorfporf3078 2 жыл бұрын
c++
@sajjadbaloch3738
@sajjadbaloch3738 2 жыл бұрын
Is it Explicit linking?
@velvethamster9809
@velvethamster9809 2 жыл бұрын
No, it’s implicit linking. Explicit doesn’t need header files or .lib files.
@TheMrFaceslasher
@TheMrFaceslasher 4 жыл бұрын
How would you do this in the same project?
@CodeTechandTutorials
@CodeTechandTutorials 4 жыл бұрын
If it's in the same project a static Library would be better. Dll's are more to be shared between many projects
@TheMrFaceslasher
@TheMrFaceslasher 4 жыл бұрын
@@CodeTechandTutorials okay, just wondering. Thank you for your video. Legitimately helped me.
@CodeTechandTutorials
@CodeTechandTutorials 4 жыл бұрын
Happy to hear it helped. I do appreciate the question. As long as you link it and have the headers you can have it in the same project essentially the same as a static Library
@zcq0730
@zcq0730 2 жыл бұрын
Thanks a lot for the excellent video! Made very easy to follow.
@xdsumi
@xdsumi 4 жыл бұрын
ty this helped a lot!
@rei1534
@rei1534 Жыл бұрын
I dont understand can someone please help me? to get my DLL from visual studio I went to France, but upon seeing it, there was only black and white text. Is this because I am stupid and should have gone to Germany instead? or would GreenGoose API give me the X location on the map in order to find the hidden treasure? Thank you for understanding 🤝
@philipgeorgiev3240
@philipgeorgiev3240 3 жыл бұрын
thanks
@davidpower635
@davidpower635 3 жыл бұрын
Just one more comment. This works fine on the command line as you have shown us but I can't get it going in Excel. I just get the file not found message even though it does exist. I have scoured the internet and there are a miriad of so called solutions, none of them apply to me. Perhaps a video on that would be cool. It seems to be a referencing problem I believe. Thank you.
@Stopinvadingmyhardware
@Stopinvadingmyhardware 3 жыл бұрын
Who asked for it? Fuck off
@evan3678
@evan3678 2 жыл бұрын
You should have called it Fiblib. Missed opportunity.
@yashkanojiya9216
@yashkanojiya9216 Жыл бұрын
No explanation just copy and past ,waste of time
@hazeshade5373
@hazeshade5373 7 ай бұрын
fiblib
@mr-maschi
@mr-maschi 3 ай бұрын
You explained nothing! Downvote
Creating C++ DLL and using it in C#
26:09
Shmuel Yaish
Рет қаралды 33 М.
C++ Dynamic Linking vs Static Linking
15:06
Jamie King
Рет қаралды 107 М.
99.9% IMPOSSIBLE
00:24
STORROR
Рет қаралды 30 МЛН
小丑女COCO的审判。#天使 #小丑 #超人不会飞
00:53
超人不会飞
Рет қаралды 16 МЛН
Don’t Choose The Wrong Box 😱
00:41
Topper Guild
Рет қаралды 60 МЛН
DLL vs EXE | Windows DLL Hell
8:10
The PC Security Channel
Рет қаралды 101 М.
Write Better Code!  |  How to Create Shared Libraries in C/C++
13:59
Using Libraries in C++ (Static Linking)
18:43
The Cherno
Рет қаралды 450 М.
99.9% IMPOSSIBLE
00:24
STORROR
Рет қаралды 30 МЛН