Bug #13087 2008-02-06 22:14

nacitar

Handling of .DEF files

If you include a .DEF file into a project, it doesn't link with it as it should. With mingw, you just specify the filename on the command line aka the linker's command line will have:

main.o somefile.o my.def

However, if I manually add the .def file to be compiled, the compiler ignores it because linking isn't being done (code::blocks compiles and links seperately, so i can't add it to gcc's command line in this way).

If I add it to the linker, it tries to link with an object file which is never generated because a .def file doesn't get compiled, and shouldn't.

DESIRED SOLUTION:

Make code::blocks recognize .def files and simply add them to the end of the linker command line if they are in the project.

LAZY SOLUTION:

Make the object file expected for a .def file be the .def file, that is:

whatever.def's properties will say Object File: whatever.def INSTEAD of whatever.o

At least with this solution, adding it to the linker manually would work.

CURRENT WORKAROUND:

Explicitly add whatever.def to the linker options.

Though __declspec(dllexport) removes the need of a .def file in many cases, in others it does not. For example, I can't get rid of stdcall decorations without a .def file.

Category
Application::WrongBehaviour
Group
 
Status
Open
Close date
 
Assigned to