我正在尝试使用MinGW编译器(在Linux上)为Windows编译MAPI example。
我尝试了直截了当的方法:
$ i686-w64-mingw32-g++ swpmain.h swpmain.cpp swap.h swap.cpp
//
// bunch of warnings here...
//
/tmp/ccggw42y.o:swap.cpp:(.text+0x2f9): undefined reference to `_MAPIInitialize@4'
/tmp/ccggw42y.o:swap.cpp:(.text+0x31c): undefined reference to `_MAPIAllocateBuffer@8'
/tmp/ccggw42y.o:swap.cpp:(.text+0x350): undefined reference to `_MAPIUninitialize@0'
/tmp/ccggw42y.o:swap.cpp:(.text+0x41a): undefined reference to `_MAPIAllocateBuffer@8'
/tmp/ccggw42y.o:swap.cpp:(.text+0x445): undefined reference to `_MAPIAllocateBuffer@8'
/tmp/ccggw42y.o:swap.cpp:(.text+0x65f): undefined reference to `_MAPIAllocateBuffer@8'
/tmp/ccggw42y.o:swap.cpp:(.text+0xf5b): undefined reference to `_MAPIFreeBuffer@4'
/tmp/ccggw42y.o:swap.cpp:(.text+0xf6c): undefined reference to `_MAPIFreeBuffer@4'
/tmp/ccggw42y.o:swap.cpp:(.text+0x1782): undefined reference to `_MAPIFreeBuffer@4'
collect2: ld returned 1 exit status
ld
错误暗示我忘了包含一些库 - 但我无法弄清楚哪一个。我尝试在usr /中搜索文件,但我只找到mapi.h
和mapix.h
标题 - 没有库。
我在这里做错了什么?