I'm running Debian Sid, using SDCC 3.5.0 for the gbz80 architecture.

In my statically-linked library, I have been using only one source file,
but today I had a reason to add another. In this second source file, I
defined gb_memcpy which is a version of standard memcpy that uses an
8-bit length parameter instead of a size_t.

I changed calls of memcpy in my library to gb_memcpy, and the library
itself compiles without error (using "sdcc -c" and packing the resulting
.rel files into an archive, as stated in the documentation). However,
when I try to compile my test program (in which I also tried to use
gb_memcpy), I got an undefined reference error claiming I had not
defined gb_memcpy for both the test module and the module in my library
which used it.

I triple-checked the .rel file to make sure it was indeed defined, and I
checked the archive to make sure that the .rel which defined the
_gb_memcpy symbol was included.

The error text shows:

?ASlink-Warning-Undefined Global '_gb_memcpy' referenced by module 'gbtest'

?ASlink-Warning-Undefined Global '_gb_memcpy' referenced by module
'gbscreen'

If there's any other information you need, I can provide it. Code itself
doesn't seem to be relevant here. I'm including the right header files
(thus the compiler doesn't error), and I've passed the proper -L flag to
include the library when compiling. I've made no changes from the last
working build of my library other than adding this file/function.

My guess is it's something to do with the existence of the separate file
and not the function itself.

Happy Hacking,

David E. McMackins II
Associate, Free Software Foundation (#12889)

www.mcmackins.org www.delwink.com
www.gnu.org www.fsf.org

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to