What are the actual error messages. Don't paraphrase: copy and paste. My guess is that your build system is not adding the necessary libraries/library paths to the linking command i.e. "symbol(s) not found". I have no idea where "collector2 Id" is coming from but I would guess that collector2 is the name of something in your code.

You would normally insert the central widget of your QMainWindow in its constructor, not main.