Hello,
Did you confirm your MQTT Mosqitto broker is installed properly? You can type the command "netstat -an" into your command prompt and look for a connection with local address "0.0.0.0:1883": this would be the Mosqutto broker. If it is not there, then you may not have installed it correctly. If it is there, make sure to start the Mosquitto broker before you run your project. Did you get that error when you are compiling your project or when running it?