I have a project with multiple .c files and one resource.h.
Now my main.c looks like this:
1 2 3 4 5 6 7 8 9 10 11 12 13
///** INDEX_CENTER **///
//-------------------//
// ** HEADERS ** //
#include "resource.h"
// ** MAIN FUNCTION ** //
int main()
{
fullScreen();
hideCursor();
menu();
}
The first 2 function are located in the same auxiliar.c file and that's ok I can create a .dll to load them in my main , but the problems comes with the 3rd function which is located in another file called menus.c
Now this menus.c has other functions too located in other files like :
ReadDeleat.c and and they are all connected to each other as I have other .c files that use these functions.
My only connection between all of these .c files is the resource.h which includes the headers the functions prototype other definitions and structs as well.
My question is How to create one single Dll for the main.c ?
If not using visual studio, then the google search to use for code::blocks is "how to build a dll library code::blocks", replace the IDE name with whatever you use.
Yes guys I'm using Code::Blocks... and I already read about it in Microsoft. Now a dynamic library shouldn't include a function definition? I mean if I include all my .c files in that 1 .dll file and call it with the main function, which request only 3 functions from that dll it will work ? I mean the main.c has no knowledge about what happens in other .c files because is only calling menu() the 3rd function, which has knowledge about what is going on with the rest of the functions.
Okay I will create from scratch a new project dll. and try add them carefully and see if its working.. I shouldn't write this program like some programmers call it (bad design)... cause now I have this code in my face and I had to think first if I wana design it to work properly with a dll file, and all I see is a mess of functions calling other functions, which is calling other functions and so on...
I can use multiple dll as well in my application to complicate less with other functions, since I already have that in my main() function I did a separate dll like this for the first 2 functions:
Now as I create the index_c.dll how do I link it in my program for the first 2 functions ?
1 2 3 4 5 6 7 8 9 10 11 12 13 14
///** INDEX_CENTER **///
//-------------------//
// ** HEADERS ** //
#include "resource.h"
// ** MAIN FUNCTION ** //
int main()
{
fullScreen(); // instead to call function from other .c file
hideCursor(); // like this ?
menu();
}