Reputation: 67
So I've written code in OpenCV which contains 2 header files using Code::Blocks. When I compile the files, there are no errors except two "undefined reference..." errors which occur because I have used functions that I have declared in the header files. I assumed that code blocks automatically linked the header files? I have used the "#include.." to include the header files at the top of the programs so not sure what the problem could be. Anyone have any idea? Thanks.
Upvotes: 2
Views: 9768
Reputation: 355
I was having a similar problem, but happened upon a solution
Click the "Project" tab, it's in the top right side.
Within the "Project" tab click the "Add Files..." option.
Highlight your Header file and any other files associated with your header file, like if you put your header files definitions in a .cpp file.
Compile and Run.
Hopefully this helps, it worked for me but our issues could be different.
Upvotes: 4