0 Replies - 347 Views - Last Post: 18 February 2012 - 05:53 AM Rate Topic: -----

#1 mpurinton  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 05-August 10

Functions defined in header files versus a source file

Posted 18 February 2012 - 05:53 AM

Placing the function in a header file instead of the C++ source file leads to compiler errors.

f(!CV_IS_IMAGE_HDR(src)) etc...
now if you check for the definition of this #define CV_IS_IMAGE_HDR you will get it as ((img) != NULL && ((const IplImage*)(img))->nSize == sizeof(IplImage)) in a missing header file.

This leads to a developer to deal with remembering to add the header file each time.
Adding it to the C++ source file, allows the linker to resolve it with an extern statement found in other source files.
Have a good coding day!

Is This A Good Question/Topic? 0
  • +

Page 1 of 1