Hey,
Reading the other topic made me slightly confused
What I can tell you is, how to decipher those errors:
"XXX was not declared in this scope"
The compiler simply can't find XXX, it doesn't even know about its existance.
Reason:
Maybe an undeclared function or variable.
Fix:
Usually including the right headers, using the correct namespace or simply declaring the function.
"undefined reference to XXX"
The compiler found a declaration of a function, but not the implementation.
Reason:
You declared it somewhere, but missed implementing it.
You did not link the library where the function is defined.
Fix:
If you made that function, implement it.
If it's from a library, In the build options of you project, in 'Linker settings' add the correct libaries to the list. I already came across cases where the order of those libraries is important, so you might try that out too.
"ld.exe: cannot find -lXXX"
Reason:
You told the linker to link a certain library, but it can't find it.
Fix:
In the build options of you project, in 'Search Directories' -> 'Linker' add the correct directories where your libs are located to the list.
If gcc can't find headers, you need to tell it where they are (in project -> build options -> search directories -> compiler)
This is similar to the lib directories.
What usually suffices to build a project with libs is to
- specify where your headers lie (in project -> build options -> search directories -> compiler)
- specify where your libs lie (in project -> build options -> search directories -> linker)
- add the libs you want to link to to the linker settings' list (in project -> build options -> linker settings)
Hope to help,
Koonschi