Problem:
using printf("%f", 1.2);
prints
%f
instead of
1.20000
Possible reasons:
no math lib included
Possible solutions:
- add -lmieee or -lmsoft (or other math library -> see vbcc manual) to list of compiler options
- put -lmieee (or whatever math lib you're using) before -lvc in list of compiler libs options
Amiga computing solutions - networking, graphics, file conversion, system setup, development, ... If you have suggestions, corrections, additions please leave a comment - thanks!
*** DISCLAIMER: The information on these pages is not an official instruction or documentation. No responsibility will be taken. Use at your own risk. ***
Showing posts with label vbcc. Show all posts
Showing posts with label vbcc. Show all posts
Tuesday, August 15, 2017
Friday, July 28, 2017
how to create a linker library with vbcc for vbcc
1. compile individual .c source code files for your desired linker library into .o object files, for example:
> path/to/linkerlib
> vc -c libfunc1.c
> vc -c libfunc2.c
will create "libfunc1.o" and "libfunc2.o"
2. use .o files as required when compiling your code, for example:
> path/to/my_program
> vc path/to/linkerlib/libfunc1.o path/to/linkerlib/libfunc2.o -o my_program my_program.c
or join .o files into one file, which is your new linker library, and use accordingly, for example:
> path/to/linkerlib
> join libfunc1.o libfunc2.o to my.lib
> path/to/my_program
> vc -Lpath/to/linkerlib -lmy -o my_program my_program.c
> path/to/linkerlib
> vc -c libfunc1.c
> vc -c libfunc2.c
will create "libfunc1.o" and "libfunc2.o"
2. use .o files as required when compiling your code, for example:
> path/to/my_program
> vc path/to/linkerlib/libfunc1.o path/to/linkerlib/libfunc2.o -o my_program my_program.c
or join .o files into one file, which is your new linker library, and use accordingly, for example:
> path/to/linkerlib
> join libfunc1.o libfunc2.o to my.lib
> path/to/my_program
> vc -Lpath/to/linkerlib -lmy -o my_program my_program.c
Subscribe to:
Posts (Atom)