John, Ki,
Can one of you guys take a look at the attached sample project and tell me why it can't find the .lib file?
thx
MikeH
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
John, Ki,
Can one of you guys take a look at the attached sample project and tell me why it can't find the .lib file?
thx
MikeH
Hi Mike,
It's because it is looking for "usbstk5515bsl.lib" in one of the defined library search paths and can't find it. Either have the full path to the library when specified in the -l option, or add the path to the lib in the -i option or simply remove the reference altogether since you already have the library physically added to your project. Any one of the three options will work (I'd simply remove it from the -l option completely since you have the library already added to the project)
Thanks
ki
MikeH,
An important paramter to any compiler or linker and one that causes the most confusion especially when using it with an IDE is the configuration of the search paths for the include and library files. Therefore in 99% of the cases where a file is not found there is an incorrect setting to either the compiler (Build Properties --> Include Options) or the linker (Build Options --> File Search Path) - the remaining 1% is due to other special conditions like no permissions to read a directory, network errors in case of remote directories, etc.
When using IDEs, the major confusion comes from the fact that sometimes the project contains all the required files to build, but the compiler or linker cannot "see" them due to misconfiguration in the properties above. In Eclipse this becomes a bit easier to happen since the project manager acts as a File Manager, therefore any files or folders that are located in the project directory are displayed in the Projects View, giving the impression the compiler/linker are also able to look for them - the tools do not try to guess to where the headers/libraries could be in your file system. (correction) In CCSv4, any libraries or include files that are in the project directory are automatically included in the build, but any libraries that are specified in the build options take precedence over the ones automatically included!
In your specific case that's exactly what is happening: although you copied the library <usbstk5515bsl.lib> to your project folder, the linker needs to be made aware of that. In the linker search path you have to include the project directory itself, described by the internal variable ${PROJECT_ROOT} is also being told there is another library of the same name but in an invalid directory, therefore throwing the error.
Hope this helps,
Rafael
Rafael, Ki,
Thanks guys for the clear answers. But, c'mon...... am I the only one who thinks that....perhaps....it is logical to assume that ....if it shows up in the root of the project GUI (because I purposely put it there), that perhaps the GUI should be smart enough (ie default config) to know where to find it? This is "common sense" to me. Can one of you guys explain why this should not be the case?
This is one of those little irritating "usability features".
If I am wrong, please enlighten me.
thx
MikeH
The feature I am requesting is to have the IDE default to searching for files in the root project directory (like C does) without having to explicitly point to them in either of the "include" or search path options in the project properties GUI. What you guys are forgetting is that there are quite a few folks, newbies as well as experienced users, trying to use this IDE and coming from different development backgrounds. Your "default" settings are not very intuitive for someone completely new to this environment.
Mike,
I corrected my post above; CCSv4 automatically picks the libraries and include files that are located in the project directory - therefore there is no need to specify the {PROJECT_ROOT} in the build options but only fix the path to point to a valid directory.
Cheers,
Rafael