I'm working on a big project written for Windows. I have ported all it's code to Linux (Ubuntu 14.04 LTS) with wine. Code compiles successful (I was trying to compile .a static library). But when I've tried to create shared library, I was getting many-many undefined references to WinAPI functions, most from winbase.h.
So, I'm trying to create "test" shared library with only one .cpp file:
Code: Select all
#include <windows.h>
#include <iostream>
using namespace std;
int main(void) {
CopyFileA(NULL, NULL, 0);
cout << "Hello World" << endl;
return 0;
}
Code: Select all
g++-4.7 -c wine_test1.cpp -I /usr/include/wine/windows/
g++-4.7 -o wt.so wine_test1.o -L /usr/lib/i386-linux-gnu/wine/ -lkernel32
Code: Select all
wine_test1.o: In function `main':
wine_test1.cpp:(.text+0x29): undefined reference to `CopyFileA'
/usr/bin/ld: wt.so: hidden symbol `CopyFileA' isn't defined
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
Code: Select all
wineg++ -c wine_test1.cpp -I /usr/include/wine/windows -lkernel32
wineg++ -o wt.so wine_test1.o -L /usr/lib/i386-linux-gnu/wine/ -lkernel32
Code: Select all
wine_test1.o: In function `main':
wine_test1.cpp:(.text+0x35): undefined reference to `CopyFileA'
/usr/lib/i386-linux-gnu/wine//libwinecrt0.a(exe_entry.o): In function `__wine_spec_exe_entry':
(.text+0x48): undefined reference to `ExitProcess'
/usr/bin/ld: wt.exe.so: hidden symbol `CopyFileA' isn't defined
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
winegcc: g++ failed