DEV Community

Discussion on: How to Write a C++ Library

Collapse
 
pauljlucas profile image
Paul J. Lucas

You really should use something like GNU Automake or CMake instead of hand-written makefiles.

You should include local headers first — then system headers. The reason is to guarantee that all local headers are self-sufficient.

Your code of:

base_class(){};
Enter fullscreen mode Exit fullscreen mode

is incorrect: functions do not have ; after the }.

Collapse
 
ra101 profile image
Parth Agarwal

Thanks for your advice, I have updated the post, with some commentary.

Collapse
 
pauljlucas profile image
Paul J. Lucas
extended_class(){};
Enter fullscreen mode Exit fullscreen mode

is still wrong. Hint: change all occurrences of }; to } for functions.

Thread Thread
 
ra101 profile image
Parth Agarwal

Man! What sort of eagle view, do you have> 😂

Thread Thread
 
pauljlucas profile image
Paul J. Lucas

I review a lot of code.