简体   繁体   中英

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM