Fix compilation errors for linux port.
Merge pull request #2522 from dumganhar/fix-building-error

Fix compilation errors for linux port.