error when compiling - linking .cpp & header file

后端 未结 2 1957
旧时难觅i
旧时难觅i 2021-01-23 08:32

I\'m attempting to link my .cpp implementation file with my header file - I get this error message from my mac terminal -

rowlandev:playground rowlandev$ g++ ma         


        
2条回答
  •  温柔的废话
    2021-01-23 09:06

    The link error says that the linked cannot find the constructor. The constructor is not in main.cpp, it is in your other file, which is unnamed in your example. Try putting all of it in a single cpp file to get it working.

提交回复
热议问题