Опытные товарищи, есть вопросы.
Использую в Linux (Fedora 11) кросс-компилятор mingw32. А конкретнее, версию для arm (arm-mingw32).
При компилировании примера (код примера под спойлером ниже), выдаёт ошибки:
Цитата
/opt/mingw32ce/bin/arm-mingw32ce-g++ -fno-exceptions -o test_wince.exe test.cpp
/tmp/ccdgZQsW.o:test.cpp:(.text+0x58): undefined reference to `CommandBar_Create'
/tmp/ccdgZQsW.o:test.cpp:(.text+0x70): undefined reference to `CommandBar_AddAdornments'
/tmp/ccdgZQsW.o:test.cpp:(.text+0xa0): undefined reference to `CommandBar_Height'
collect2: ld returned 1 exit status
make: *** [wince] Ошибка 1
Более подробный вывод ошибок.
make wince
/opt/mingw32ce/bin/arm-mingw32ce-g++ -fno-exceptions -v -o test_wince.exe test.cpp
Using built-in specs.
Target: arm-mingw32ce
Configured with: /usr/src/rpm/BUILD/cegcc-mingw32ce-0.55/src/gcc/configure --with-gcc --with-gnu-ld --with-gnu-as --target=arm-mingw32ce --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
Thread model: win32
gcc version 4.1.0
/opt/mingw32ce/libexec/gcc/arm-mingw32ce/4.1.0/cc1plus -quiet -v -D__COREDLL__ -D__MINGW32__ -D__MINGW32CE__ -D__CEGCC_VERSION__ -idirafter ../include/w32api -idirafter ../../include/w32api test.cpp -quiet -dumpbase test.cpp -auxbase test -version -fno-exceptions -o /tmp/ccOgODGH.s
ignoring nonexistent directory "/opt/mingw32ce/lib/gcc/arm-mingw32ce/4.1.0/../../../../arm-mingw32ce/sys-include"
ignoring nonexistent directory "../include/w32api"
ignoring nonexistent directory "../../include/w32api"
#include "..." search starts here:
#include <...> search starts here:
/opt/mingw32ce/lib/gcc/arm-mingw32ce/4.1.0/../../../../include/c++/4.1.0
/opt/mingw32ce/lib/gcc/arm-mingw32ce/4.1.0/../../../../include/c++/4.1.0/arm-mingw32ce
/opt/mingw32ce/lib/gcc/arm-mingw32ce/4.1.0/../../../../include/c++/4.1.0/backward
/opt/mingw32ce/lib/gcc/arm-mingw32ce/4.1.0/include
/opt/mingw32ce/lib/gcc/arm-mingw32ce/4.1.0/../../../../arm-mingw32ce/include
End of search list.
GNU C++ version 4.1.0 (arm-mingw32ce)
compiled by GNU C version 4.3.2.
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: 1ccab0ce77fd000b9b5f232ad151db14
/opt/mingw32ce/lib/gcc/arm-mingw32ce/4.1.0/../../../../arm-mingw32ce/bin/as -o /tmp/ccFSX8cJ.o /tmp/ccOgODGH.s
/opt/mingw32ce/libexec/gcc/arm-mingw32ce/4.1.0/collect2 -Bdynamic -o test_wince.exe /opt/mingw32ce/lib/gcc/arm-mingw32ce/4.1.0/../../../../arm-mingw32ce/lib/crt3.o -L/opt/mingw32ce/lib/gcc/arm-mingw32ce/4.1.0 -L/opt/mingw32ce/lib/gcc/arm-mingw32ce/4.1.0/../../../../arm-mingw32ce/lib /tmp/ccFSX8cJ.o -lstdc++ -lmingw32 -lgcc -lceoldname -lmingwex -lcoredll -lcoredll -lmingw32 -lgcc -lceoldname -lmingwex -lcoredll
/tmp/ccFSX8cJ.o:test.cpp:(.text+0x58): undefined reference to `CommandBar_Create'
/tmp/ccFSX8cJ.o:test.cpp:(.text+0x70): undefined reference to `CommandBar_AddAdornments'
/tmp/ccFSX8cJ.o:test.cpp:(.text+0xa0): undefined reference to `CommandBar_Height'
collect2: ld returned 1 exit status
Пример кода, который пробуется:
/============================================================
#include <windows.h>
#include <commctrl.h> // подключение линейки команд
LRESULT CALLBACK MainWndProc(HWND, UINT, WPARAM,LPARAM);
TCHAR szAppName[] = TEXT ("TinyCE");
HINSTANCE hInst;
int WINAPI WinMain (HINSTANCE hInstance,
HINSTANCE hPrevInstance, LPWSTR lpCmdLine,
int nCmdShow) {
WNDCLASS wc;
HWND hWnd;
MSG msg;
hInst = hInstance;
memset (&wc, 0, sizeof (wc));
wc.lpfnWndProc = MainWndProc;
wc.hInstance = hInstance;
wc.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);
wc.lpszClassName = szAppName;
if (RegisterClass(&wc) == 0) return -1;
hWnd = CreateWindow (szAppName,
szAppName,
WS_VISIBLE,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
NULL,
NULL,
hInstance,
NULL);
if (!IsWindow (hWnd)) return -2;
ShowWindow (hWnd, nCmdShow);
UpdateWindow (hWnd);
while (GetMessage (&msg, NULL, 0, 0)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return 0;
}
LRESULT CALLBACK MainWndProc(HWND hWnd, UINT wMsg,
WPARAM wParam, LPARAM lParam) {
HWND hwndCB;
PAINTSTRUCT ps;
RECT rect;
HDC hdc;
switch (wMsg) {
case WM_CREATE:
hwndCB = CommandBar_Create (hInst, hWnd, 0x10);
CommandBar_AddAdornments (hwndCB, 0, 0);
break;
case WM_PAINT:
GetClientRect (hWnd, &rect);
rect.top += CommandBar_Height (GetDlgItem (hWnd, 0x10));
hdc = BeginPaint (hWnd, &ps);
DrawText (hdc, TEXT ("Hello Windows CE!"), -1, &rect,
DT_CENTER | DT_VCENTER | DT_SINGLELINE);
EndPaint (hWnd, &ps);
break;
case WM_DESTROY:
break;
}
return DefWindowProc(hWnd, wMsg, wParam, lParam);
}
Все заголовочные файлы есть и лежат, где нужно. Что за ошибка и как исправить?