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.
Tool/software: TI C/C++ Compiler
I ran into an issue with the compiler v3.3.3 and CCSv4.2.3 where if I change the "Optimization level" to anything other than the existing 3 then I have a linker error, as in:
<Linking>
undefined first referenced
symbol in file
--------- ----------------
I_LSR ./Msg.obj
error: unresolved symbols remain
error: errors encountered during linking; "ELD.out" not built
If I open up this old legacy project and leave it as is (Optimization level = 3), it compiles fine. I do want to turn off the optimization temporarily to do some debugging.
Appreciate any suggestions,
ED
I am not certain as to what is happening. But I have a good guess. And if that guess is correct, the solution is to re-install the compiler.
This error ...
snuk said:undefined first referenced
symbol in file
--------- ----------------
I_LSR ./Msg.obj
... means the module Msg.obj (probably built from Msg.c) calls a function named I_LSR, but that function is not present in any other object module or library used in the build.
The function I_LSR performs a logical right shift. That's a computation for the C expression unsigned_value >> count. When you build with --opt_level=3, this expression is somehow optimized away, or performed inline. At lower levels of optimization, the RTS routine I_LSR is called to evaluate the expression.
The compiler RTS library, in a module named lsr16.obj (built from lsr16.asm) supplies the function I_LSR. I don't know why your RTS library does not have it. I don't think it makes sense to worry about how that happened. Re-installing the compiler will fix it.
snuk said:I ran into an issue with the compiler v3.3.3 and CCSv4.2.3
Those tools are about 8 years old. I'm not sure it is possible to update them any more. But I think it is worth a try. Your compiler is installed in a location similar to ...
C:\ti\ccsv4\tools\compiler\msp430_3.3.3
Rename this directory to something else. Then install compiler version 3.3.3 using the directions in the first part of the article Compiler Releases. Ignore the part about free downloads. Version 3.3.3 is not available that way.
Thanks and regards,
-George
Thanks for the info George,
When I initially installed CCSv4 I had compiler v3.3.2, which gave me this issue. I had updated the compiler to v3.3.3 just before I posted this question and I still had the same error. So not sure if upgrading to v3.3.3 is the solution in this matter.
EDIT 1: Just looked at the ti folder I saw nothing else but C:\ti\ccsv4\license. No tools folder. Not sure where the compilers reside!
EDIT 2: After a bit diggin it was actually under C:\Program Files (x86)\Texas Instruments\ccsv4\tools\compiler\MSP430 Code Generation Tools 3.3.3... Anyway, this is a newly updated compiler which was done a few days ago before posting, and I still have the linker error.
EDIT 3: I resolved the error by setting up the appropriate search paths to the library in "MSP430 Linker/File Search Path", which was somehow corrupted in our old legacy projects.
Regards,
ED