Hi,
I get the following linker error, and I don't know why.
"### mwldmcf.exe Usage Error:
# No library file found matching 'libcf{.dylib|.a}' or 'cf'"
I am using the following flags for the linker to specify the libraries:
-lr "C:\Program Files\Freescale\CodeWarrior for ColdFire V7.0\ColdFire_Support\msl\MSL_C\MSL_ColdFire\Lib"
-lr "C:\Program Files\Freescale\CodeWarrior for ColdFire V7.0\ColdFire_Support\Runtime"
-lr "C:\Program Files\Freescale\CodeWarrior for ColdFire V7.0\ColdFire_Support\Libraries"
-l+C_4i_CF_Runtime.a
-l+C_4i_CF_SZ_MSL.a
I even have the environment variables set:
CWFolder=C:\Programs Files\Freescale\CodeWarrior\CodeWarrior for ColdFire V7.0
MWLibraries=%CWFolder%\ColdFire_Support\Libraries;%CWFolder%\ColdFire_Support\Runtime;%CWFolder%\ColdFire_Support\msl\MSL_C\MSL_ColdFire\Lib
I followed this post: How to use Linker from command line(error: mwldmcf.exe: No library file found matching mwldmcf.exe:...
I searched for "libcf.a", "cf.a", and "*.dylib" in the CWFolder and I get no results.
Any advice or tips?
Solved! Go to Solution.
Hello
The option -lcf is creating trouble.
In order to specify the .lcf file used for linking just add the path to the .lcf file to your linker command line.
I would remove the option -lcf "lcf\MCF52211_INTERNAL_FLASH.lcf" and just add lcf\MCF52211_INTERNAL_FLASH.lcf right before the list of object files.
CrasyCat
Hello
Apparently the linker is looking for a file called libcf.a.
How did you set environment variable MWLibraryFiles?
How does your linker command line look like? Which arguments are you passing there?
CrasyCat
MWLibraryFiles is not defined in my "CodeWarrior Development Studio ColdFire® Architectures Edition Build Tools Reference" which I found under the help documentation, so I do not have it set to anything.
The following is the command being passed to the linker with the project object file name redacted:
"C:\Program Files\Freescale\CodeWarrior for ColdFire V7.0\ColdFire_Tools\Command_Line_Tools\mwldmcf.exe" -lcf "lcf\MCF52211_INTERNAL_FLASH.lcf" -processor MCF521X -msgstyle gcc -lr "C:\Program Files\Freescale\CodeWarrior for ColdFire V7.0\ColdFire_Support\msl\MSL_C\MSL_ColdFire\Lib" -lr "C:\Program Files\Freescale\CodeWarrior for ColdFire V7.0\ColdFire_Support\Runtime" -lr "C:\Program Files\Freescale\CodeWarrior for ColdFire V7.0\ColdFire_Support\Libraries" -main '__startup' -force_active '__vect','__cfm' -sreclength 32 -breclength 252 -sreceol unix -keeplocal off -nodeadstrip -listing -show all -warn on -g -l+C_4i_CF_Runtime.a -l+C_4i_CF_SZ_MSL.a [list of project specific '.o' object files] -o bin/MCF52211_INTERNAL_FLASH.elf
mwldmcf.exe: No library file found matching 'libcf{.dylib|.a}' or 'cf'
Errors caused tool to abort.
make: *** [bin/MCF52211_INTERNAL_FLASH.elf] Error 1
Notably, this is the first invocation of the linker on the object files.
*EDIT: One thing that I just noticed was the the processor I have specified is "MCF521X". This is listed on its own in the command line help, but the IDE has "MCF521x/5221x/5222x" all in one option. I am assuming that the processor option I chose for the command line actually covered the processors as stated in the IDE, but I may be wrong. I don't see anything in the docs to clarify this.
Message was edited by: Michael D
Hello
The option -lcf is creating trouble.
In order to specify the .lcf file used for linking just add the path to the .lcf file to your linker command line.
I would remove the option -lcf "lcf\MCF52211_INTERNAL_FLASH.lcf" and just add lcf\MCF52211_INTERNAL_FLASH.lcf right before the list of object files.
CrasyCat
Hi CrasyCat,
That solved the issue I was having! Thank you!
After modifying the linker command a bit to make sure that I am specifying all the windows paths correctly, I am now consistently getting an application error. Please see here: mwldmcf.exe application error memory read
I consider this thread answered.