User forums > Using Code::Blocks

Default search directory

(1/2) > >>

J_Will:
Hello,
Many tutorials describing how to link a library to a project indicate that you must specify the compiler and linker paths in the build options.
However, I note that if we do not specify these access paths and the headers and lib.a are positioned in the include and lib directories of MinGW then the program is correctly built. The question is: Where these default access paths are specified in Code::blocks ?

Thanks.

Grit Clef:
Do you mean the default headers and libraries that MinGW can read automatically? If not, then you do need to specify their paths except that you have already specified them in the search paths.

J_Will:
For example, when I link GLEW (for opengl) to a project:
1) I copy all the header GL/*.h in C:\Program Files (x86)\CodeBlocks\MinGW\include
2) I copy libglew.a in C:\Program Files (x86)\CodeBlocks\MinGW\lib
3) I add glew in the liker settings of the project
4) I build the project and it works fine.

I don't have to add include and lib paths in the search directories of the project.
It seems that Code::block searches in these directories by default...
 

Grit Clef:
It's not finished by CodeBlocks, because you copied those files to MinGW's include and lib directory. The compiler will search those directory by default.

J_Will:
Ok thank you. Thi sis due to the compiler. That means many tutorials are wrong :)

Navigation

[0] Message Index

[#] Next page

Go to full version