Hi,
I'm making a Static Library that calls a function that does not yet
exists, but is defined by the program that uses the library.
How can i accomplish this? I know it's possible with DLL's, but
that's not what i want.
Thx in advanced.
Printable View
Hi,
I'm making a Static Library that calls a function that does not yet
exists, but is defined by the program that uses the library.
How can i accomplish this? I know it's possible with DLL's, but
that's not what i want.
Thx in advanced.
I didn't really understand you but this may help: (I hope)
Wrong
Code:int main()
{
myfunction(5,3);
return 0;
}
int myfunction(int param1, int param2)
{
lalalala;
return 0;
}
Right (Except for the lalala thingey :P)
Code:int myfunction(int, int)
int main()
{
myfunction(5,3);
return 0;
}
int myfunction(int param1, int param2)
{
lalalala;
return 0;
}
Tell me if this is what you meant.
No, fun though to be treated like a beginner:p .
What you posted is for the compiler to know that this function
exists before it stumbled across it's definition. What i ment
was that it called a function from another yet to be coded
source code.
the library:
the source that is created after the library has been compiledCode:
void blab();
void blob()
{
blab();
}
Code:
void blab()
{
}
Could you go more into this?Quote:
Originally posted by Salem
you pass the function to be called as a parameter to some call into the library.
Or, why not just use polymorphism. We're not limitted to C anymore, remember?
Define a base class with a virtual member function and make children in another project.
You're able to have a pointer to a function?
Aren't you able to tell the lib wich function to run?
Then it's all solved isn't it?
Try this one
I just love a google search
Yeah, i removed the tutorial request because i thought i was getting likeQuote:
alot of other people here, requesting before searching, sorryz.
Thx for such a specific tutorial though.