Include Wine in my project and using WinGDI under Linux.

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
JuryS
Level 2
Level 2
Posts: 23
Joined: Fri Jul 31, 2009 5:15 pm

Include Wine in my project and using WinGDI under Linux.

Post by JuryS »

Hy guys, I make my application for Windows/Linux/Mac and I have problem with next using:

I'm include in my project next headers:

#ifndef WNT
#include </tmp/include/windef.h>
#include </tmp/include/winbase.h>
#include </tmp/include/wingdi.h>
#include </tmp/include/winuser.h>
#include </tmp/include/winerror.h>
#endif

And It's cool working with libEMF.so, but what the library of wine I must include ?

for the sample, I'm try to use libwine.so.1, gdi32.dll.so,gdiplus.dll.so

But my compiler have this errors:

../obj/ExportImage.o: In function `exportimg::eraseEMFPen()':
ExportImage.cpp:(.text+0x612): undefined reference to `SelectObject'
ExportImage.cpp:(.text+0x622): undefined reference to `DeleteObject'
../obj/ExportImage.o: In function `exportimg::PrintEMFHeader()':
ExportImage.cpp:(.text+0x6cd): undefined reference to `CreateEnhMetaFileA'
make: Выход из каталога `/tmp/Visual3D'
ExportImage.cpp:(.text+0x6e5): undefined reference to `SetMapMode'
ExportImage.cpp:(.text+0x708): undefined reference to `SetWindowExtEx'
ExportImage.cpp:(.text+0x760): undefined reference to `SetViewportExtEx'
ExportImage.cpp:(.text+0x7a2): undefined reference to `SetViewportOrgEx'
ExportImage.cpp:(.text+0x7ba): undefined reference to `SetBkMode'
ExportImage.cpp:(.text+0x7d2): undefined reference to `SetTextAlign'
../obj/ExportImage.o: In function `exportimg::PrintEMFFooter()':
ExportImage.cpp:(.text+0x1812): undefined reference to `SelectObject'
ExportImage.cpp:(.text+0x1822): undefined reference to `DeleteObject'
ExportImage.cpp:(.text+0x1836): undefined reference to `CloseEnhMetaFile'
ExportImage.cpp:(.text+0x1841): undefined reference to `DeleteEnhMetaFile'
../obj/ExportImage.o: In function `exportimg::createEMFPen(float*, float)':
ExportImage.cpp:(.text+0x187c): undefined reference to `SelectObject'
ExportImage.cpp:(.text+0x188c): undefined reference to `DeleteObject'
ExportImage.cpp:(.text+0x193e): undefined reference to `CreatePen'
ExportImage.cpp:(.text+0x1957): undefined reference to `SelectObject'
../obj/ExportImage.o: In function `exportimg::PrintEMFPrimitive(void*)':
ExportImage.cpp:(.text+0x1c25): undefined reference to `MoveToEx'
ExportImage.cpp:(.text+0x1ca7): undefined reference to `LineTo'
ExportImage.cpp:(.text+0x1d2b): undefined reference to `CreateSolidBrush'
ExportImage.cpp:(.text+0x1d7a): undefined reference to `CreatePen'
ExportImage.cpp:(.text+0x1d90): undefined reference to `SelectObject'
ExportImage.cpp:(.text+0x1da9): undefined reference to `SelectObject'
ExportImage.cpp:(.text+0x1e55): undefined reference to `Polygon'
ExportImage.cpp:(.text+0x1e6c): undefined reference to `SelectObject'
ExportImage.cpp:(.text+0x1e77): undefined reference to `DeleteObject'
ExportImage.cpp:(.text+0x1e8e): undefined reference to `SelectObject'
ExportImage.cpp:(.text+0x1e99): undefined reference to `DeleteObject'
../obj/ExportImage.o: In function `exportimg::EndPage()':
ExportImage.cpp:(.text+0x2233): undefined reference to `CloseEnhMetaFile'
ExportImage.cpp:(.text+0x223e): undefined reference to `DeleteEnhMetaFile'
ExportImage.cpp:(.text+0x22e2): undefined reference to `SelectObject'
ExportImage.cpp:(.text+0x22f2): undefined reference to `DeleteObject'
/usr/bin/ld: Visual3D: hidden symbol `DeleteObject' isn't defined
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: ld returned 1 exit status

But this function I'm know in gdi ELF library.... Or there another way to use winelib ?

Many thanks
Thunderbird
Level 5
Level 5
Posts: 336
Joined: Mon Nov 24, 2008 8:10 am

Post by Thunderbird »

The only way to use winelib is to use winegcc/wineg++. Wine is not a plain library against which you can link.
JuryS
Level 2
Level 2
Posts: 23
Joined: Fri Jul 31, 2009 5:15 pm

Post by JuryS »

Thunderbird wrote:The only way to use winelib is to use winegcc/wineg++. Wine is not a plain library against which you can link.
I don't think that is good idea to use winegcc/wineg++, because I'm create my application with Qt not only for linux. I'm create my library for EMF export/import under Linux. And there no complete function in wine 1.2 for create polygon and bezier in 32 bit winGDI.

I want get part of developing of Wine for wine project.
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Post by vitamin »

JuryS wrote:I don't think that is good idea to use winegcc/wineg++
It's not an option, it's a requirement. You can not link to Wine libraries and expect it to work. It's like a program that would link to X libraries and expect things to work without X running.
JuryS
Level 2
Level 2
Posts: 23
Joined: Fri Jul 31, 2009 5:15 pm

Post by JuryS »

I think that will not make special work to make additional headings for a call of these functions as dynamic. Now I work over it. We will admit, as HDC I transfer parametre of an operating window in Winuser32.

I think will work so:

wine-> user32.dll-> startmyconvertor

or I must to recompile wine function for my program as libEMF.so... There is like 640 kB, and then is not wine need for working my program.. Only dynamic library.

Also, I'm want to ask: what is license of wine ? I'm need to make any information about using wine code. I'm from Russia and we are don't use any license like GPL.
ryan woodsmall

Include Wine in my project and using WinGDI under Linux.

Post by ryan woodsmall »

I think that will not make special work to make additional headings for a call of these functions as dynamic. Now I work over it. We will admit, as HDC I transfer parametre of an operating window in Winuser32.

I think will work so:

wine-> user32.dll-> startmyconvertor

or I must to recompile wine function for my program as libEMF.so... There is like 640 kB, and then is not wine need for working my program.. Only dynamic library.
I don't know that I fully understand you, but winelib is used to port, via source recompilation, Windows apps to Linux. It's not transparent. Wine and its runtime environment is needed to run these applications, winegcc is necessary for compilation. You can't simply link to a library and expect it to work. If you want to include win32 code in a Linux port, you need winelib+winegcc+Wine.

Look at the winelib page and the user's guide that's linked on that page:

http://www.winehq.org/winelib

If you *aren't* using Win32-specific code, you should be able to port a library to Linux-native without any Wine prereqs. But that's a question for another list/forum since it doesn't have anything to do with Wine.
Also, I'm want to ask: what is license of wine ? I'm need to make any information about using wine code. I'm from Russia and we are don't use any license like GPL.
Literally one second of Googling (using "wine license") will tell you that Wine uses the LGPL license.

-r
JuryS
Level 2
Level 2
Posts: 23
Joined: Fri Jul 31, 2009 5:15 pm

Re: Include Wine in my project and using WinGDI under Linux.

Post by JuryS »

Many thanks for your answer.
Locked