2005/11/28, Eric House <[EMAIL PROTECTED]>: > Ok, that's helping. I added four or five function that were clearly > missing -- i.e. present in the .h files and declared as functions rather > than as macros or something. That fixed most of my link problems.
Great! > obj_wince/cemain.o(.text+0x208):cemain.c: undefined reference to > `_CommandBar_AddBitmap' > > The CommandBar functions require a separate library in MS's dev tools, Adding a new library is also easy. Create a new .def file and an empty .munge file. Add the names of the symbols to the .def file, and add the name of the library to LIBRARIES in the Makefile. Rebuild the package. > so I'm not surprised I can't find 'em in the header files. > What does surprise me is that I get link rather than compile errors. It sounds like the compiler is finding the function declarations in the header files, but that the linker is not finding the function definitions in an appropriate library. > obj_wince/cesockwr.o(.text+0x6d8):cesockwr.c: undefined reference to > `_closesocket' > > I use a bunch of other winsock functions, e.g. socket() and htonl(), > and they link. Like closesocket, they're listed in winsock.def. So I > don't know why closesocket isn't linking. The functions listed in winsock.munge are renamed from xxx to M$_xxx because they conflict with the POSIX functions of the same name. You could call M$_closesocket, but since the name closesocket doesn't conflict with the POSIX function close, I'd suggest simply removing closesocket from the munge file and rebuild. The same goes for ioctlsocket. It just occured to me though that the newlib's libc calls M$_closesocket and M$_ioctlsocket though, so you'd either have to patch libc as well, or provide aliases so that both names for the function are present. > /usr/arm-wince-pe/lib/libc.a(startup.o)(.text+0x234): In function `_startup': > /home/sjackman/work/debian/pocketpc/gcc/pocketpc-gcc-3.4.2/build/arm-wince-pe/newlib/libc/sys/wince/../../../../../../newlib/libc/sys/wince/startup.c:105: > undefined reference to `_main' > > I assume I'm missing some obvious step to point the linker at a bit of > startup glue, but the commands you sent for building the 'hello world' app > worked without anything else. Are you providing a function named main, and not perhaps WinMain? WinMain won't work. > apt-src segfaults on my machine, but 'apt-get -b source packagename' did > the same thing. How odd. Submit a Debian bug report to apt-src. Sounds like you're getting much closer! Cheers, Shaun