If it works trough IDE and not trough command line then it is big posibility that when using command line you don't specify proper folder locations for all necessary libraries. You should check wch parameters are usied when the project is being compiled by IDE.