Использую кросс-компилятор mingw32. А конкретнее, версию для arm (arm-mingw32).
При компилировании примера (исходный код примера в архиве) выдаёт ошибки:
[peter@notebook trayapp_wince]$ make wince
/opt/mingw32ce/bin/arm-mingw32ce-g++ -D_WIN32_WCE=0x500 -D_WIN32_IE=0x600 -fno-exceptions -o trayapp_wince.exe trayapp.cpp -I/opt/mingw32ce/arm-mingw32ce/include -L/opt/mingw32ce/arm-mingw32ce/lib -lcommctrl -laygshell -lcoredll
/tmp/cccAL0fa.o:trayapp.cpp:(.text+0x70): undefined reference to `Shell_NotifyIconW'
collect2: ld returned 1 exit status
make: *** [wince] Ошибка 1
Более подробный вывод ошибок:
[zueuk@zueuk trayapp_wince]$ make wince
/opt/mingw32ce/bin/arm-mingw32ce-g++ -v -D_WIN32_WCE=0x500 -D_WIN32_IE=0x600 -fno-exceptions -o trayapp_wince.exe trayapp.cpp -I/opt/mingw32ce/arm-mingw32ce/include -L/opt/mingw32ce/arm-mingw32ce/lib -lcommctrl -laygshell -lcoredll
Using built-in specs.
Target: arm-mingw32ce
Configured with: /mnt/vint-1/src/cegcc/src/gcc-4.4.0/configure --with-gcc --with-gnu-ld --with-gnu-as --build=i686-pc-linux-gnu --target=arm-mingw32ce --host=i686-pc-linux-gnu --prefix=/opt/mingw32ce --enable-threads=win32 --disable-nls --enable-languages=c,c++ --disable-win32-registry --disable-multilib --disable-interwork --without-newlib --enable-checking --with-headers --disable-__cxa_atexit
Thread model: win32
gcc version 4.4.0 (GCC)
COLLECT_GCC_OPTIONS='-v' '-D_WIN32_WCE=0x500' '-D_WIN32_IE=0x600' '-fno-exceptions' '-o' 'trayapp_wince.exe' '-I/opt/mingw32ce/arm-mingw32ce/include' '-L/opt/mingw32ce/arm-mingw32ce/lib' '-shared-libgcc'
/opt/mingw32ce/libexec/gcc/arm-mingw32ce/4.4.0/cc1plus -quiet -v -I/opt/mingw32ce/arm-mingw32ce/include -D__COREDLL__ -D__MINGW32__ -D__MINGW32CE__ -D__CEGCC_VERSION__ -idirafter ../include/w32api -idirafter ../../include/w32api -D_WIN32_WCE=0x500 -D_WIN32_IE=0x600 trayapp.cpp -quiet -dumpbase trayapp.cpp -auxbase trayapp -version -fno-exceptions -o /tmp/ccLuotAU.s
ignoring nonexistent directory "/opt/mingw32ce/lib/gcc/arm-mingw32ce/4.4.0/../../../../arm-mingw32ce/sys-include"
ignoring nonexistent directory "../include/w32api"
ignoring nonexistent directory "../../include/w32api"
ignoring duplicate directory "/opt/mingw32ce/arm-mingw32ce/include"
as it is a non-system directory that duplicates a system directory
#include "..." search starts here:
#include <...> search starts here:
/opt/mingw32ce/lib/gcc/arm-mingw32ce/4.4.0/../../../../arm-mingw32ce/include/c++/4.4.0
/opt/mingw32ce/lib/gcc/arm-mingw32ce/4.4.0/../../../../arm-mingw32ce/include/c++/4.4.0/arm-mingw32ce
/opt/mingw32ce/lib/gcc/arm-mingw32ce/4.4.0/../../../../arm-mingw32ce/include/c++/4.4.0/backward
/opt/mingw32ce/lib/gcc/arm-mingw32ce/4.4.0/include
/opt/mingw32ce/lib/gcc/arm-mingw32ce/4.4.0/include-fixed
/opt/mingw32ce/lib/gcc/arm-mingw32ce/4.4.0/../../../../arm-mingw32ce/include
End of search list.
GNU C++ (GCC) version 4.4.0 (arm-mingw32ce)
compiled by GNU C version 4.4.1 20090725 (Red Hat 4.4.1-2), GMP version 4.2.4, MPFR version 2.4.1.
warning: GMP header version 4.2.4 differs from library version 4.3.1.
warning: MPFR header version 2.4.1 differs from library version 2.4.2.
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: b723c3473a20e7ac9a6bcadd9b86489d
COLLECT_GCC_OPTIONS='-v' '-D_WIN32_WCE=0x500' '-D_WIN32_IE=0x600' '-fno-exceptions' '-o' 'trayapp_wince.exe' '-I/opt/mingw32ce/arm-mingw32ce/include' '-L/opt/mingw32ce/arm-mingw32ce/lib' '-shared-libgcc'
/opt/mingw32ce/lib/gcc/arm-mingw32ce/4.4.0/../../../../arm-mingw32ce/bin/as -v -I/opt/mingw32ce/arm-mingw32ce/include -o /tmp/ccCJZPqZ.o /tmp/ccLuotAU.s
GNU assembler version 2.20.51 (arm-mingw32ce) using BFD version (GNU Binutils) 2.20.51.20091016
COMPILER_PATH=/opt/mingw32ce/libexec/gcc/arm-mingw32ce/4.4.0/:/opt/mingw32ce/libexec/gcc/arm-mingw32ce/4.4.0/:/opt/mingw32ce/libexec/gcc/arm-mingw32ce/:/opt/mingw32ce/lib/gcc/arm-mingw32ce/4.4.0/:/opt/mingw32ce/lib/gcc/arm-mingw32ce/:/opt/mingw32ce/lib/gcc/arm-mingw32ce/4.4.0/../../../../arm-mingw32ce/bin/
LIBRARY_PATH=/opt/mingw32ce/lib/gcc/arm-mingw32ce/4.4.0/:/opt/mingw32ce/lib/gcc/arm-mingw32ce/4.4.0/../../../../arm-mingw32ce/lib/
COLLECT_GCC_OPTIONS='-v' '-D_WIN32_WCE=0x500' '-D_WIN32_IE=0x600' '-fno-exceptions' '-o' 'trayapp_wince.exe' '-I/opt/mingw32ce/arm-mingw32ce/include' '-L/opt/mingw32ce/arm-mingw32ce/lib' '-shared-libgcc'
/opt/mingw32ce/libexec/gcc/arm-mingw32ce/4.4.0/collect2 -Bdynamic -o trayapp_wince.exe /opt/mingw32ce/lib/gcc/arm-mingw32ce/4.4.0/../../../../arm-mingw32ce/lib/crt3.o -L/opt/mingw32ce/arm-mingw32ce/lib -L/opt/mingw32ce/lib/gcc/arm-mingw32ce/4.4.0 -L/opt/mingw32ce/lib/gcc/arm-mingw32ce/4.4.0/../../../../arm-mingw32ce/lib /tmp/ccCJZPqZ.o -lcommctrl -laygshell -lcoredll -lstdc++ -lmingw32 -lgcc_s -lgcc -lceoldname -lmingwex -lcoredll -lcoredll -lmingw32 -lgcc_s -lgcc -lceoldname -lmingwex -lcoredll
/tmp/ccCJZPqZ.o:trayapp.cpp:(.text+0x70): undefined reference to `Shell_NotifyIconW'
collect2: ld returned 1 exit status
make: *** [wince] Ошибка 1
Т.е. не находит определение функции. Хорошо. Перехожу в папку с заголовочными файлами и ищу определение этой функции:
grep Shell_NotifyIconW *
shellapi.h:BOOL WINAPI Shell_NotifyIconW(DWORD,PNOTIFYICONDATAW);
shellapi.h:#define Shell_NotifyIcon Shell_NotifyIconW
На одном из форумов ответили, что
т.к. ругается линкер, то смотреть надо не заголовочный файл, линкер на него не смотрит, он смотрит a-файл. видимо в нём, что-то не сходится с заголовочником.
Нашел, как просмотреть библиотеки на наличие функций. Делается это с помощью команды strings.
[zueuk@zueuk lib]$ /opt/mingw32ce/bin/arm-mingw32ce-strings -f /opt/mingw32ce/arm-mingw32ce/lib/lib*.a |grep Shell_NotifyIcon
/opt/mingw32ce/arm-mingw32ce/lib/libcoredll6.a: Shell_NotifyIcon
/opt/mingw32ce/arm-mingw32ce/lib/libcoredll6.a: __imp_Shell_NotifyIcon
/opt/mingw32ce/arm-mingw32ce/lib/libcoredll6.a: Shell_NotifyIcon
/opt/mingw32ce/arm-mingw32ce/lib/libcoredll6.a: Shell_NotifyIcon
/opt/mingw32ce/arm-mingw32ce/lib/libcoredll6.a: __imp_Shell_NotifyIcon
/opt/mingw32ce/arm-mingw32ce/lib/libcoredll.a: Shell_NotifyIcon
/opt/mingw32ce/arm-mingw32ce/lib/libcoredll.a: __imp_Shell_NotifyIcon
/opt/mingw32ce/arm-mingw32ce/lib/libcoredll.a: Shell_NotifyIcon
/opt/mingw32ce/arm-mingw32ce/lib/libcoredll.a: Shell_NotifyIcon
/opt/mingw32ce/arm-mingw32ce/lib/libcoredll.a: __imp_Shell_NotifyIcon
Так же указывал такие определения:
#undef WINVER
#define WINVER 0x500
#undef _WIN32_WINNT
#define _WIN32_WINNT 0x500
Но, ошибка все равно присутствует. Не знаю, что еще можно попробовать?!