Hello there,
I'm currently playing with creating and using DLLs with MinGW.
I've written the following files:
test.h
Code:
#ifndef __TEST_H__
#define __TEST_H__
int addOne(int);
#endif
test.c
Code:
#include "test.h"
int addOne(int i)
{
return i + 1;
}
test_test.c
Code:
#include <stdio.h>
#include "test.h"
int main()
{
int i = addOne(13);
printf("%d\n", i);
return 0;
}
I compliled my DLL using the following line:
gcc -Wall -shared test.c test.dll
I then compile the application using this line:
gcc test_test.c test.dll -o test_test.exe
Running the file test_test.exe worked fine. But when I moved test.dll to a folder called lib and recompiled test_test with
gcc test_test.c lib/test.dll -o test_test.exe
trying to run the application results in an error mentioning that test.dll cannot be found. I'm unable to find any decent information on this so if someone could explain to me why this is and what can be done to allow test_test.exe to look in the correct place for test.dll I would be very greatful.
Thanks
marclurr