Problems in Compiling MFC

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
suse
Level 1
Level 1
Posts: 6
Joined: Tue Feb 17, 2009 4:48 am

Problems in Compiling MFC

Post by suse »

1) i'm facing problem while compiling MFC code
when "winemaker" command is given i get these lines

admin@XXX:~/.wine/drive_c/windows/system32/MFC> winemaker --lower-uppercase .
Winemaker 0.6.0
Copyright 2000 Francois Gouget <[email protected]> for CodeWeavers
closedir() attempted on invalid dirhandle DIRECTORY at /usr/local/bin/winemaker line 1054.
closedir() attempted on invalid dirhandle DIRECTORY at /usr/local/bin/winemaker line 1054.
Scanning the source directories...
closedir() attempted on invalid dirhandle DIRECTORY at /usr/local/bin/winemaker line 607.
closedir() attempted on invalid dirhandle DIRECTORY at /usr/local/bin/winemaker line 607.
closedir() attempted on invalid dirhandle DIRECTORY at /../winemaker line 607.
closedir() attempted on invalid dirhandle DIRECTORY at /../winemaker line 607.
closedir() attempted on invalid dirhandle DIRECTORY at /../winemaker line 607.
Fixing the source files...
BiCubicInterpolation_CPU_Video.cpp
BiCubicInterpolation_OpenGL_Common.cpp
BiCubicInterpolation_OpenGL_Video.cpp
BindDC_OpenGL.cpp
InputBox.cpp
Source_Files/BiCubicInterpolation_CPU_Video.cpp
Source_Files/BindDC_OpenGL.cpp
Source_Files/ChildView.cpp
Source_Files/InputBox.cpp
Source_Files/MainFrm.cpp
Source_Files/MyCmdLineInfo.cpp
Source_Files/TestApp.cpp
Resource_Files/SingleAlg_CPU_Video.rc
BiCubicInterpolation_OpenGL.h
BiCubicInterpolation_OpenGL_Common.h
BindDC_Common.h
Header_Files/ChildView.h
Header_Files/InputBox.h
Header_Files/MainFrm.h
Header_Files/MyCmdLineInfo.h
Header_Files/Resource.h
Header_Files/TestApp.h
Header_Files/stdafx.h
MyCmdLineInfo.h
Resource_Files/res/SingleAlg_CPU_Video.rc2
Source_Files/stdafx.cpp
readImage.h
dicom_io.h
SingleAlg_CPU_Video.rc
warning: In non-MFC projects, winemaker replaces the MFC specific header 'afxres.h' with 'winres.h'
warning: the above warning is issued only once
Generating project files...


2) when the "make" command is given, this is how the output looks like



admin@XXX:~/.wine/drive_c/windows/system32/MFC> make
wineg++ -shared dicom_io.dll.spec -mno-cygwin -o dicom_io.dll.so -lodbc32 -lole32 -loleaut32 -lwinspool -luuid
winegcc: File does not exist: dicom_io.dll.spec
make: *** [dicom_io.dll.so] Error 2


3) Can u please let me know how to create solve problem regarding .spec and .so files

4) Should i install wine through source archive or RPM installation is sufficent to compile any MFC???
Please help me out :roll: :cry: :!: :x

thank u in advance
Thunderbird
Level 5
Level 5
Posts: 336
Joined: Mon Nov 24, 2008 8:10 am

Post by Thunderbird »

Wine doesn't contain an implementation of mfc and so can't be used for compiling winelib apps using mfc UNLESS you would compile the microsoft mfc sources. People did that in the past and it worked to some degree but it has legal issues.

If you really need mfc the only way would be to run your app as a win32 app using wine and only split some parts into dlls which you can replace with winelib dlls. (For Wine there is no real difference if your app is a win32 executable or a winelib one. In all cases Wine is used to run it and further for wine there is no difference between a .dll file and a winelib .dll.so)
suse
Level 1
Level 1
Posts: 6
Joined: Tue Feb 17, 2009 4:48 am

Post by suse »

Thanku for reply...

Please tell me, Can I compile an MFC applicaiton by installing Wine through RPM package (simple RPM based installation of Wine, 1st kind of installation)? :!: :?:
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Post by vitamin »

suse wrote:Please tell me, Can I compile an MFC applicaiton by installing Wine through RPM package
No. Wine does not contain anything related to MFC.
suse
Level 1
Level 1
Posts: 6
Joined: Tue Feb 17, 2009 4:48 am

Post by suse »

If it is not related to MFC then how come in the WineLib User Guide a Particular topic is given to Compile the MFC and even OpenGL related games are running in Wine, which is also a MFC application?
Thunderbird
Level 5
Level 5
Posts: 336
Joined: Mon Nov 24, 2008 8:10 am

Post by Thunderbird »

The winelib tutorial is very old. As far as I know nobody recently used it to compile MFC as distributing a winelib dll.so of mfc would have legal issues.

Wine implements core windows dlls and mfc is more a runtime library which lots of apps ship. When a program provides mfc it will work fine. It also works fine if you just put the dll in wine its system32 directory. Since we don't provide our own libmfc.dll.so you can't use it with winelib. (though you could try to create a dummy mfc winelib dll with which you link and then use the real mfc dll; not sure if this works though)
User avatar
DanKegel
Moderator
Moderator
Posts: 1164
Joined: Wed May 14, 2008 11:44 am

Post by DanKegel »

The error didn't really look MFC related, but:

Older versions of mfc (e.g. the one that comes with Visual Studio C++ 6)
have an EULA that iirc allows app developers to bundle compiled
mfc with their apps regardless of platform. It's only newer ones that
don't allow that. Also Wine can't ever bundle MFC as it's not an app.

That said, why are you trying to use winelib? Why not just use the
windows binaries for whatever you're doing? Are you trying to target
some non-x86 architecture?
suse
Level 1
Level 1
Posts: 6
Joined: Tue Feb 17, 2009 4:48 am

Post by suse »

hello,

How should I remove winegcc error!!!!!

I' compiling an SDI application in wine, when I give make command, this is error i'm getting....

Code: Select all

admin@XXX:-./wine/drive_c/windows/system32/MFC>
makewinegcc -c -mno-cygwin -I -o dicom_io_main.o dicom_io_main.c
dicom_io_main.c:In function 'DllMain':
dicom_io_main.c:26: error: 'DLL_WINE_PREATTACH' undeclared (first use in this function)
dicom_io_main.c: error : (Each undeclared identifier is reported only once
dicom_io_main.c:26: error: for each function it appears in.)
winegcc:  gcc failed
make:*** [dicom_io_main.o] Error 2
pls help me ...
I would like to know how to solve winegcc error !!!

eagerly waiting for ur reply
User avatar
André H.
Moderator
Moderator
Posts: 207
Joined: Sun Dec 07, 2008 8:33 am

Post by André H. »

first you should try to compile the MFC with winelib, then compile your app with this.

a non-wine-way would be to port your app from MFC to http://wxWidgets.org which is similar but runs on more platforms.
John Drescher

Problems in Compiling MFC

Post by John Drescher »

first you should try to compile the MFC with winelib, then compile your app with this.

a non-wine-way would be to port your app from MFC to wxWidgets.org which is similar but runs on more platforms.
Or Qt (which I recommend).

John
Locked