LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

dll prototype with no implementation

I'm wondering how it is I can have an exported function protype declared within a dll  and no implementation for it and it still builds without error?

 

Doen't an .exe build break when this happens?

 

Menchar

0 Kudos
Message 1 of 4
(3,311 Views)
Maybe the linker allows this because for all it "knows", the dll will load another dll with the implementation?
0 Kudos
Message 2 of 4
(3,292 Views)

for what i have tested, the compiler ignores the incomplete exported function: the function is not listed in the exported symbols of the resulting binary.

it is the same for an executable: if you declare a function but do not define it, the function is ignored. a link error is triggered only if you call the function from inside your code.
0 Kudos
Message 3 of 4
(3,268 Views)

Well, if it isn't really exported then at least it won't allow a client to try and invoke a non-existent function, which is what I thought might be happening.

 

I wonder what the thinking was in C on this issue - maybe it's a compatability thing since C doesn't require prototypes.

 

Thanks.

0 Kudos
Message 4 of 4
(3,252 Views)