user2129623
user2129623

Reputation: 2257

How to call dll file from main function?

I have two function which process the string coming from main.cpp file and returns bool result.

I create dll file executing project with kmp.h and kmp.cpp files. [This files contains function defination which process string from main.cpp]

How can I use dll file generated from this execution for main.cpp file? so that I can directly pass string from main.cpp and dll file return me output as I have coded in kmp.cpp file?

Upvotes: 0

Views: 376

Answers (1)

wolf
wolf

Reputation: 127

You need to link your kmp library with your main program. kmp.dll should not include a main because it is just a library, but a function that your main.cpp can call which performs the desired operation. You will need to tell your IDE to link against your kmp library, and include your kmp header file at the top of your main.cpp. you will be able to compile with just the header included but you will need to link your dll to actually use your executable.

Upvotes: 2

Related Questions