undefined reference to vtable for …

前端 未结 4 1443
余生分开走
余生分开走 2021-01-13 03:42

I am trying to write an Http proxy that basically works like indianwebproxy

So i fired up qtcreator and but one of my classes is failing to compile with the infamous

4条回答
  •  旧时难觅i
    2021-01-13 04:14

    This is often caused by not linking the files generated by automoc.

    First, you need to run automoc on the headers where classes using Q_OBJECT are defined, in your case "httpproxythreadbrowser.h". This will generate a "*.moc" file.

    Now there are two common approaches how to continue. Either you can #include the .moc file at the end of your .cpp file with class definition or you can pass it to the compiler as anoher source file.

提交回复
热议问题