"undefined reference to '__aeabi_idivmod'" or "undefined reference to '__aeabi_uidiv'". It would really help if you could explain this to me.Don't use the -nostdlib compiler option :)
Spyro - Thanks! Most people won't need it, but it could be cool to show to your friendsMost of my friends don't even know what a graphing calculator is. :P
getting C to create a string that can be a variable size (but stays the same length after declaration) requires malloc(), and when the string length changes each time you type... UGH!!!Try using realloc(), that will resize a buffer without modifying its contents (and may return a new pointer if the buffer couldn't be resized in-place). Of course, you may not want to reallocate for every character typed, so you could probably increase/decrease the size by, for example, 32 bytes at a time.
I still got "An Error Has Occurred!" page. :(??? Maybe it is because it is in Spam, you may need 100 posts, I don't know.
int numPow(int in1[], int in2[], int output[], int in1len, int in2len)
For that parameter (called output[]), I pass it the pointer to an array, and the array has only one int in it.int *ans = malloc(4); // One int
int ansLen = numPow(in1, in2, ans, numInts1, numInts2);
The power function keeps calling my multiplication function, and resizes the array whenever it needs to. (Now that I think about it, this might not be so smart)int a;
int b = 2000000000; // Still within range
int c = 2000000000; // Still within range
a = (b * c) % 10000000000; // Last 10 digits of the product
Does that work, or will it cause overflow? I am wondering because right now, I am storing numbers as arrays of ints with 4 digits in each int, which is quite inefficient.
Also, (Not really related) If you have:Code: [Select]int a;
Does that work, or will it cause overflow? I am wondering because right now, I am storing numbers as arrays of ints with 4 digits in each int, which is quite inefficient.
int b = 2000000000; // Still within range
int c = 2000000000; // Still within range
a = (b * c) % 10000000000; // Last 10 digits of the product
mv: cannot stat `gmp-5.0.4': No such file or directory
mkdir: cannot create directory `build': File exists
mkdir: cannot create directory `prefix': File exists
configure: WARNING: If you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used.
../src/configure: line 27268: /c/Program: No such file or directory
configure: WARNING: +----------------------------------------------------------
configure: WARNING: | Cannot determine global symbol prefix.
configure: WARNING: | /c/Program Files (x86)/yagarto/bin/arm-none-eabi-nm output doesn't contain a global data symbol.
configure: WARNING: | Will proceed with no underscore.
configure: WARNING: | If this is wrong then you'll get link errors referring
configure: WARNING: | to ___gmpn_add_n (note three underscores).
configure: WARNING: | In this case do a fresh build with an override,
configure: WARNING: | ./configure gmp_cv_asm_underscore=yes
configure: WARNING: +----------------------------------------------------------
configure: WARNING: "/c/Program Files (x86)/yagarto/bin/arm-none-eabi-nm" failure
configure: WARNING: cannot determine local label, using default L
../src/configure: line 27607: /c/Program: No such file or directory
../src/configure: line 27607: /c/Program: No such file or directory
configure: error: cannot determine how to define a 32-bit word
#!/bin/sh
# This creates a "gmp" subdirectory whereever you launch the script, and compiles and installs in subdirectories thereof.
WORKING_DIR=`pwd`
mv gmp-5.0.4 src
mkdir build
mkdir prefix
cd build
../src/configure --host=arm-none-eabi --prefix="$WORKING_DIR/prefix" --enable-shared=no --enable-assert || exit 1
make && make install
c:\yagarto\bin\arm-none-eabi-nm.exe: conftest.o: File format not recognized
configure: WARNING: +----------------------------------------------------------
configure: WARNING: | Cannot determine global symbol prefix.
configure: WARNING: | /c/yagarto/bin/arm-none-eabi-nm output doesn't contain a global data symbol.
configure: WARNING: | Will proceed with no underscore.
configure: WARNING: | If this is wrong then you'll get link errors referring
configure: WARNING: | to ___gmpn_add_n (note three underscores).
configure: WARNING: | In this case do a fresh build with an override,
configure: WARNING: | ./configure gmp_cv_asm_underscore=yes
configure: WARNING: +----------------------------------------------------------
configure: WARNING: "/c/yagarto/bin/arm-none-eabi-nm" failure
configure: WARNING: cannot determine local label, using default L
c:\yagarto\bin\arm-none-eabi-nm.exe: conftest.o: File format not recognized
c:\yagarto\bin\arm-none-eabi-nm.exe: conftest.o: File format not recognized
configure: error: cannot determine how to define a 32-bit word
configure:5440: checking compiler arm-none-eabi-gcc -O2 -pedantic -fomit-frame-pointer
Test compile:
configure:5454: arm-none-eabi-gcc -O2 -pedantic -fomit-frame-pointer conftest.c >&5
c:/yagarto/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/lib\libc.a(lib_a-exit.o): In function `exit':
C:\msys\1.0\home\yagarto\newlib-build\arm-none-eabi\newlib\libc\stdlib/../../../../../newlib-1.19.0/newlib/libc/stdlib/exit.c:65: undefined reference to `_exit'
collect2: ld returned 1 exit status
configure:5457: $? = 1
failed program was:
int main () { return 0; }