Warning / error for exported function missing when creating dll

I have noticed that when you create a dll in Visual Studio function is declared __ declspec (dllexport) , but with no implementation , silently dropped > from dll . Thus, no error occurs until this particular function is called by the client, and an unsatisfied communication error occurs.

I came across this today when a colleague renamed a function, but only made a change in the header and not in the source file, and this function has been quietly removed from our dll export from now on.

I tried level 4 level in VS2013, and the warning did not even appear.

Now I am wondering if there are other incorrect pairs in our library. Of course, it would be great if the compiler at least warned about it, but ideally this could cause an error.

Question: Does anyone know how to raise a warning / error for a missing implementation for dllexport in Visual Studio?

We build our library on all popular OSs and compilers, and everyone builds perfectly without errors (although, perhaps, a warning that we never noticed ...)

+4
source share

All Articles