Blue-unicorne
Blue-unicorne

Reputation: 397

.lib generated when compiling .exe program

I've been trying to figure this one out for the last couple of days and I haven't found anything related on the web.

I have a series of Projects which generate .exe files using Visual Studio 2012 (the behavior happens under newer versions as well). I use Property Sheets to set all compile options; therefore, all my CL & Link switches are consistent throughout my .exe Projects. I have verified that none of the switches haven been locally overwritten within the problem Projects.

So the issue I have is that 2 of my 41 Projects generate .lib & .exp files AS WELL as the desired .exe file. I've never seen this before and I don't quite understand why those would be needed for .exe. It's as if the linker momentarily treats the Projects as .dll, but ultimately generates an .exe.

Would anyone know if this could be expected behavior, under certain conditions?

Thanks for the help.

I have found this link, which pretty much exactly describes what I'm getting. But the solution doesn't seem to apply in my case.

Why does my Visual C++ .exe project build create .lib and .exp files?

Upvotes: 1

Views: 680

Answers (1)

Blue-unicorne
Blue-unicorne

Reputation: 397

Alright... After a lot more digging, I have finally found the problem.

The issue was indeed related to the one mentioned in the link I had provided. Somewhere, under an old Sun Microsystem library (portmap related), there was 1 function which had the __declspec(dllexport) statement in it. Even though that library is used by all my .exe projects, only the 2 problem programs were indirectly calling the exported function.

In retrospect... I should have simply looked at the .lib file directly. It showed which single function was exported.

Upvotes: 2

Related Questions