Andes Workshop

It is currently Thu Nov 14, 2019 6:56 pm

All times are UTC + 8 hours [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: undefined reference to `__adddf3'
PostPosted: Thu Feb 27, 2014 11:51 pm 
Offline
User avatar

Joined: Fri Mar 04, 2011 9:36 pm
Posts: 500
Code:

#include <stdio.h>
#include <stdlib.h>

int main(void) {

   double a = 123456.0;
   double b = 65432.0;

   double c ;
   int d = 5;

   c= a+b;
   c= a-b;
   c= a*b;
   c= a/b;

   printf("%lf",c);

   return EXIT_SUCCESS;
}


Some errors occur:
C:\Andestech\AndeSight201MCU\mcu_64\workspace\float_test\Debug/../src/float_test.c:22: undefined reference to `__adddf3'
C:\Andestech\AndeSight201MCU\mcu_64\workspace\float_test\Debug/../src/float_test.c:22: undefined reference to `__adddf3'
C:\Andestech\AndeSight201MCU\mcu_64\workspace\float_test\Debug/../src/float_test.c:23: undefined reference to `__subdf3'
C:\Andestech\AndeSight201MCU\mcu_64\workspace\float_test\Debug/../src/float_test.c:23: undefined reference to `__subdf3'
C:\Andestech\AndeSight201MCU\mcu_64\workspace\float_test\Debug/../src/float_test.c:24: undefined reference to `__muldf3'
C:\Andestech\AndeSight201MCU\mcu_64\workspace\float_test\Debug/../src/float_test.c:24: undefined reference to `__muldf3'
C:\Andestech\AndeSight201MCU\mcu_64\workspace\float_test\Debug/../src/float_test.c:25: undefined reference to `__divdf3'
C:\Andestech\AndeSight201MCU\mcu_64\workspace\float_test\Debug/../src/float_test.c:25: undefined reference to `__divdf3'
C:\Andestech\AndeSight201MCU\mcu_64\workspace\float_test\Debug/../src/float_test.c:27: undefined reference to `printf'
C:\Andestech\AndeSight201MCU\mcu_64\workspace\float_test\Debug/../src/float_test.c:27: undefined reference to `printf'

This is because we set "-nostdlib" to avoiding default library. Delete this option can solve the problem.
Attachment:
solution.png
solution.png [ 80.42 KiB | Viewed 3926 times ]


Sample code: (This have link errors)
Attachment:
float_test.zip [13.42 KiB]
Downloaded 293 times



Reference:
http://stackoverflow.com/questions/2187 ... pplication


Top
 Profile Send private message E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group