Revert "Revert "fixed linking error from bad commit""

This reverts commit 7c396813cc936fb002821f1abcc4b1b73710eb06.