Atmel Studio 6 Linker Error : collect2: ld [solved]

I sucessfully built and tested the sample Blink example to blink LED on my Mega2560 board and LCD example to display stuff on my LCD1602. Then I added some more code that uses LCD and EEPROM libraries. However, I am getting the following linker error:

Building target: TimeWarp.elf
		Invoking: AVR8/GNU Linker : (AVR_8_bit_GNU_Toolchain_3.4.0_663) 4.6.2
		"C:\Program Files (x86)\Atmel\Atmel Studio 6.0\extensions\Atmel\AVRGCC\3.4.0.65\AVRToolchain\bin\avr-g++.exe" -o TimeWarp.elf  Declarations.o merlin_mount.o MsTimer2.o TimerOne.o TimeWarp.o TW_Camera.o TW_EEPROM.o TW_IO.o TW_Merlin.o TW_Motor.o TW_UI.o TW_UI_Screen.o TW_UI_Values.o   -Wl,-Map="TimeWarp.map" -Wl,--start-group -Wl,-lm -Wl,-lcore  -Wl,--end-group -Wl,-L"C:\Users\Komal\Documents\Atmel Studio\ArduinoCore" -Wl,-L"C:\Users\Komal\Documents\Atmel Studio\ArduinoLibraries\LiquidCrystal" -Wl,-L"C:\Users\Komal\Documents\Atmel Studio\ArduinoLibraries\EEPROM"  "C:\Users\Komal\Documents\Atmel Studio\ArduinoCore\LiquidCrystal.o" -Wl,"C:\Users\Komal\Documents\Atmel Studio\ArduinoCore\EEPROM.o" -Wl  -mmcu=atmega2560  
		c:/program files (x86)/atmel/atmel studio 6.0/extensions/atmel/avrgcc/3.4.0.65/avrtoolchain/bin/../lib/gcc/avr/4.6.2/../../../../avr/lib/avr6\libm.a(unordsf2.o):/home/tools/hudson/workspace/avr8-gnu-toolchain/src/avr-libc/libm/fplib/unordsf2.S:42:(.text.avr-libc.fplib+0x0): relocation truncated to fit: R_AVR_13_PCREL against symbol `__fp_cmp' defined in .text.avr-libc.fplib section in c:/program files (x86)/atmel/atmel studio 6.0/extensions/atmel/avrgcc/3.4.0.65/avrtoolchain/bin/../lib/gcc/avr/4.6.2/../../../../avr/lib/avr6\libm.a(fp_cmp.o)
		collect2: ld returned 1 exit status
		make: *** [TimeWarp.elf] Error 1
	Done executing task "RunCompilerTask" -- FAILED.

I looked around a lot for a solution to this problem, but no success. Can anyone please point me in the right direction?

Thanks

Does the code compile and link in the IDE?

PaulS:
Does the code compile and link in the IDE?

Well, all I have is a bunch of cpp and h files. I don't know how to convert the to Arduino IDE format. The main file that has setup() and loop() is in a cpp file. Should I just copy paste that into a pde file and then just place the other classes in the same directory and somehow add them to the project?

Solved! Just flipped the order of libm and libcore in the linker settings and it worked. Here is the Link to the avr forum that helped.

this the corrected link
http://www.avrfreaks.net/comment/874542#comment-874542