when you create a new project, don't forget to add the following sentence in .pro file
LIBS += -lCGAL -lCGAL_Core
it will remind the system to link CGAL library.
TEMPLATE = app
CONFIG += console c++11
CONFIG -= app_bundle
CONFIG -= qt
SOURCES += main.cpp
LIBS += -lCGAL -lCGAL_Core
Then you can paste the source code you want in CGAL library into main.cpp, then change it as you like.