I am using code::blocks and have written a dll. I am currently testing it but am getting tired of having to compile it, copy the DLL, DEF, H and A files into a test project, and then compiling the test project every time I need to fix something. Is there any easier way to test a DLL?

2
Contributors
6
Replies
9
Views
6 Years
Discussion Span
Last Post by Labdabeta

The only file you need in the test project folder is the *.dll. Actually, you can put it any of the folders listed in your PATH environment variable, such as c:\windows\system. As for the *.h file(s), just put the full path to where they are located in the include statement, e.g. `#include "c:\mydir\test.h"` Application programs do not need any of the other files you mentioned.

Edited by Ancient Dragon

Usually, you can put it any of the folders listed in your PATH environment variable, such as c:\windows\system. Af for the `*.h` file(s), just put the full path to where they are located in the include statement, e.g. `#include "c:\mydir\test.h"` Application programs do not need any of the other files you mentioned.

The problem is that I tried that and I got a ton of link errors! I know that that method worked for two other DLLs I made (one for random numbers, one for infinite math) I feel like I did something wrong in this DLL project's settings.

Edited by mike_2000_17: Fixed formatting

Did you link with the *.lib file that was generated when you compiled the *.dll?

Yes, although my compiler called it MyDLLName.DLL.a I only get the link errors on some seemingly arbitrary functions. The link error I get looks like:
`undefined reference to '_imp__LABglClose@4'`

Check the *.def file to make sure you exported that function.

Aha! For some weird reason the default setting was for debug builds to NOT create .a files, so I was using files from my last Release build, which was incomplete.