Folks,
msvcrt has this in its spec file:
dlls/msvcrt/msvcrt.spec:@ forward -noimport _itoa ntdll._itoa
^^^^^^^^^ This is your problem. This tell winebuild to not export this function to winelib apps. The reason for this is probably to make pepole use the native unix version. Why I dont know.
Yet at link time, I get an undefined reference error:
/home/dimi/dev/wine/wine/tools/winebuild/winebuild -fPIC -DSTRICT -o visual-mingw.exe.spec.c --exe visual-mingw.exe -m gui -r rsrc.res CList.o editor.o main.o process.o project.o winui.o -L/home/dimi/dev/wine/wine/dlls -ladvapi32 -lole32 -lcomdlg32 -lcomctl32 -lshell32 -luser32 -lgdi32 -lkernel32 -lmsvcrt gcc -D_WIN32_IE=0x0400 -c -o visual-mingw.exe.spec.o visual-mingw.exe.spec.c g++ -shared -Wl,-Bsymbolic visual-mingw.exe.spec.o CList.o editor.o main.o process.o project.o winui.o -o visual-mingw.exe.so -L/home/dimi/dev/wine/wine/library -lwine -lm project.o: In function `CProject::Open(char*, unsigned short)': project.o(.text+0x20e5): undefined reference to `_itoa' winui.o: In function `CStatusBar::WriteLong(long, int)': winui.o(.text+0x1d9a): undefined reference to `_itoa' winui.o: In function `CMessageBox::DisplayLong(long)': winui.o(.text+0x30a2): undefined reference to `_itoa'
However, if I also link in ntdll, it works:
/home/dimi/dev/wine/wine/tools/winebuild/winebuild -fPIC -DSTRICT -o visual-mingw.exe.spec.c --exe visual-mingw.exe -m gui -r rsrc.res CList.o editor.o main.o process.o project.o winui.o -L/home/dimi/dev/wine/wine/dlls -ladvapi32 -lole32 -lcomdlg32 -lcomctl32 -lshell32 -luser32 -lgdi32 -lkernel32 -lntdll -lmsvcrt gcc -D_WIN32_IE=0x0400 -c -o visual-mingw.exe.spec.o visual-mingw.exe.spec.c g++ -shared -Wl,-Bsymbolic visual-mingw.exe.spec.o CList.o editor.o main.o process.o project.o winui.o -o visual-mingw.exe.so -L/home/dimi/dev/wine/wine/library -lwine -lm [dimi@dimi src]$
In ntdll the export does not have the -noimport flag set so that is why it works
Question is, is this correct? Do I need to link ntdll into the app as well?
I wouldnt think so but Im not sure because whats the difference if people use it directly from ntdll or from msvcrt?
nog.