Error loading mfc42.dll - failed (error c000007b)

Questions about Wine on Linux
Locked
cpighin
Level 2
Level 2
Posts: 30
Joined: Sat Dec 04, 2010 12:51 pm
Location: Italy, Ciampino (Rome)

Error loading mfc42.dll - failed (error c000007b)

Post by cpighin » Sat Dec 04, 2010 1:28 pm

:D Hi,

I installed wine on ubuntu 10.10 to run a windows program as reported here (http://appdb.winehq.org/objectManager.p ... ngId=59338).
After few trails I decided to reinstall Wine (now version 1.3.8 ), to configure it as instructed by the guide, and than to install again the windows application, Birthday Reminder.
At present the application doesn't run for a problem with mfc42.dll
Here the code from my terminal

Code: Select all

claudio@Aspire-8530:~$ wine "c:\\Programmi\\Birthday Reminder\\bday.exe"
Trying to load PE image for unsupported architecture (AMD-64)
err:module:import_dll Loading library MFC42.DLL (which is needed by L"C:\\Programmi\\Birthday Reminder\\bday.exe") failed (error c000007b).
err:module:LdrInitializeThunk Main exe initialization for L"C:\\Programmi\\Birthday Reminder\\bday.exe" failed, status c0000135
I ask for your help, thanks :D

Claudio

User avatar
DanKegel
Moderator
Moderator
Posts: 1164
Joined: Wed May 14, 2008 11:44 am

Post by DanKegel » Sat Dec 04, 2010 3:10 pm

Ran fine for me with just
winetricks mfc42

but the log message you posted,
"Trying to load PE image for unsupported architecture (AMD-64)"

makes me think you've done something funny. Try again
with an empty .wine directory.

cpighin
Level 2
Level 2
Posts: 30
Joined: Sat Dec 04, 2010 12:51 pm
Location: Italy, Ciampino (Rome)

Post by cpighin » Sun Dec 05, 2010 4:38 pm

Thanks Dan for your reply :)

Consider that before the actual installation of Wine, I did few actions to try to solve the problem with the previous installation and one of them was the use of winetricks to load the mfc42 library, of course without any result.

Consider also that before writing this post, I copied file mfc42.dll (taken from my windows system) into my /home/claudio directory where I found it is located the file bdays.ini with data used by Birthday Reminder, hoping that the application would work. Than I gave the command:
wine "c:\\Programmi\\Birthday Reminder\\bday.exe"
and I get the same result as reported in msg #1 :cry:

The file mfc42.dll is copied actually into following Ubuntu directories:
/home/claudio
/home/claudio/.wine/drive_c/Programmi
/home/claudio/.wine/drive_c/Programmi/Birthday Reminder

Any idea to help?

Claudio :)

vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Post by vitamin » Sun Dec 05, 2010 6:16 pm

cpighin wrote:The file mfc42.dll is copied actually into following Ubuntu directories:
How about you just use 'winetricks mfc42' and don't copy that file all over your HDD? http://wiki.winehq.org/winetricks

cpighin
Level 2
Level 2
Posts: 30
Joined: Sat Dec 04, 2010 12:51 pm
Location: Italy, Ciampino (Rome)

Post by cpighin » Mon Dec 06, 2010 3:09 am

:) Vitamin,

because I am not expert and I don't want to do confused actions, I need an expert that guides me step by step. So, since you appears to be more expert than me, if you ensure your patient help I will follow your instructions.

I take this occasion to recall that, before installing the actual version of Wine, I was used to run the previous one as SU and it was working. I am confident that if I do the same with the actual Wine installation, it will work, but I learned that it is not a good practice to start Wine as SU.

Can you explain why I get en error message using command:
wine "c:\\Programmi\\Birthday Reminder\\bday.exe"
as normal user and not if I use it as SU?

Claudio :)

User avatar
dimesio
Moderator
Moderator
Posts: 12671
Joined: Tue Mar 25, 2008 10:30 pm

Post by dimesio » Mon Dec 06, 2010 7:02 am

cpighin wrote: Can you explain why I get en error message using command:
wine "c:\\Programmi\\Birthday Reminder\\bday.exe"
as normal user and not if I use it as SU?
If you've been running as root, you've messed up the permissions in your wineprefix. Follow these instructions to fix it: http://wiki.winehq.org/FAQ#head-8b89c92 ... 96093e1484

Also, delete all the versions of mfc42 you've manually installed.

I downloaded the app; it starts up fine here after installing winetricks mfc42.

cpighin
Level 2
Level 2
Posts: 30
Joined: Sat Dec 04, 2010 12:51 pm
Location: Italy, Ciampino (Rome)

Post by cpighin » Mon Dec 06, 2010 12:43 pm

Hi dimesio :)

What you say affected my first installation of Wine (1.2.1) and consider that I have yet tried to solve the issue applying the procedure you linked.

Actual installation of Wine(1.3.8) is a clean one and I suppose there are not permission problems.

Claudio :)

User avatar
dimesio
Moderator
Moderator
Posts: 12671
Joined: Tue Mar 25, 2008 10:30 pm

Post by dimesio » Mon Dec 06, 2010 2:04 pm

cpighin wrote: What you say affected my first installation of Wine (1.2.1) and consider that I have yet tried to solve the issue applying the procedure you linked.

Actual installation of Wine(1.3.8) is a clean one and I suppose there are not permission problems.
Upgrading Wine does not fix ~/.wine, and that's where your permissions problems are. If the instructions in the wiki didn't work, delete ~/.wine and start over.

cpighin
Level 2
Level 2
Posts: 30
Joined: Sat Dec 04, 2010 12:51 pm
Location: Italy, Ciampino (Rome)

Post by cpighin » Tue Dec 07, 2010 3:46 pm

:) dimesio,

If I remember correctly, before installing Wine1.3.8, I deleted ~/.wine directory, but my memory is not strong so it is possible that the problem is there.

Before cancelling ~/.wine and re-installing again Wine, I would try other ways. It may be interesting a test I did few minutes ago with "sudo".

Here is the code:

Code: Select all

claudio@Aspire-8530:~$ sudo wine "c:\\Programmi\\Birthday Reminder\\bday.exe" 
[sudo] password for claudio: 
wine: /home/claudio/.wine is not owned by you
May be you or some other expert can understand the problem combining the above information with the code of my first msg.

Claudio :)

cpighin
Level 2
Level 2
Posts: 30
Joined: Sat Dec 04, 2010 12:51 pm
Location: Italy, Ciampino (Rome)

Nuova installazione - 1° mistero da svelare

Post by cpighin » Wed Dec 08, 2010 6:58 am

:) Ho seguito il consiglio di dimesio e mi sono imbattuto in un mistero che spero di svelare col contributo degli esperti.

Ecco cosa ho fatto passo-passo.

- Ho disinstallato Wine1.3.8 da gestore pacchetti con la funzione "rimuovi completamente"; sono stati rimossi wine1.3, Wine1.3-gecko, winetricks,
- Ho cancellato la cartella .Wine (proprietario: claudio) col comando: rm -r .wine.

Code: Select all

claudio@Aspire-8530:~$ rm -r .wine
rm: rimuovere il file regolare protetto dalla scrittura `.wine/drive_c/Programmi/Birthday Reminder/instlog.lsl'? y
claudio@Aspire-8530:~$ 
- Ho verificato che la cartella è stata rimossa con tutto il suo contenuto.
- Ho disinstallato tramite gestore pacchetti wine1.3, Wine1.3-gecko, winetricks.
- Ho installato nuovamente wine1.3 (poi risultato 1.3.8 ) da gestore pacchetti che ha richiesto anche Wine1.3-gecko e winetricks
- Dopo l'installazione ho cercato la cartella .Wine e non l'ho trovata
- Ho poi cominciato a configurare Wine utilizzando questa guida: http://www.winehq.org/docs/wineusr-guid ... S-VERSIONS e, prima ancora di fare la prima azione, ho trovato Wine nell'elenco delle applicazioni e, al suo interno, la cartella Birthday Reminder e i suoi lanciatori dedicati (Applicazioni > Wine > Programmi > Birthday Reminder > Setup/Check now).
- Mi sono chiesto: come mai trovo l'applicazione che non ho ancora installato?
- Allora ho navigato all'interno del sistema di cartelle e ho verificato che la cartella Applicazioni > Wine > Programmi > Birthday Reminder non esiste. Tuttavia esiste la la cartella .Wine (sempre con proprietario: claudio) che prima non avevo visto (?)
- Seconda domanda: Allora, come mai vedo Birthday Reminder tra le applicazioni di Ubuntu?

Gentili esperti, mi date una mano a capire cosa succede?

Claudio :)

User avatar
dimesio
Moderator
Moderator
Posts: 12671
Joined: Tue Mar 25, 2008 10:30 pm

Re: Nuova installazione - 1° mistero da svelare

Post by dimesio » Wed Dec 08, 2010 7:35 am

cpighin wrote::) Ho seguito il consiglio di dimesio
You need to post in English.

cpighin
Level 2
Level 2
Posts: 30
Joined: Sat Dec 04, 2010 12:51 pm
Location: Italy, Ciampino (Rome)

Post by cpighin » Wed Dec 08, 2010 8:44 am

:) Thank you dimesio,

I forgot to be in en English spoken forum!

I followed your advice and I came across a mystery that I hope to unravel with experts assistance.

Here's what I did step by step.

- I un-installed Wine1.3.8 by package manager with "remove completely". wine1.3, Wine1.3-gecko and winetricks were removed.
- I deleted the folder .Wine (owner: Claudio) with the command: rm-r .Wine.

Code: Select all

Claudio @ Aspire-8530: ~ $ rm-r. wine
rm: remove write-protected regular file `.wine / drive_c / Programs / Birthday Reminder / instlog.lsl '? y
Claudio @ Aspire-8530: ~ $
- I checked that the folder was really removed with all its contents.
- I reinstalled wine1.3 (resulted as version 1.3.8 ) by package manager and Wine1.3-gecko and winetricks were installed as well.
- After installation I looked for the folder .Wine and I have not found it!
- then, when I was starting to configure Wine using this guide: http://www.winehq.org/docs/wineusr-guid ... S-VERSIONS , and before making any action, I found Wine listed in the Ubuntu applications and, within it, the folder Birthday Reminder and its dedicated launcher (Applications> Wine> Programs> Birthday Reminder> Setup / Check now).
- I asked myself: Why I find an application which I have not installed?
- Then I looked inside the system folder and I checked that folder Applications> Wine> Programs> Birthday Reminder was not there. However, folder .Wine was there (always with owner: claudio).
- Second question: Why I have not seen it before (?)


Dear experts, would you give me an hand to understand what's happening?

Claudio :)

User avatar
dimesio
Moderator
Moderator
Posts: 12671
Joined: Tue Mar 25, 2008 10:30 pm

Post by dimesio » Wed Dec 08, 2010 9:39 am

cpighin wrote:- I asked myself: Why I find an application which I have not installed?
- Then I looked inside the system folder and I checked that folder Applications> Wine> Programs> Birthday Reminder was not there. However, folder .Wine was there (always with owner: claudio).
- Second question: Why I have not seen it before (?)


Dear experts, would you give me an hand to understand what's happening?
1. http://wiki.winehq.org/FAQ#head-8a17a13 ... aaf043d581

2. Linux is case-sensitive. .Wine is not the same as .wine.

cpighin
Level 2
Level 2
Posts: 30
Joined: Sat Dec 04, 2010 12:51 pm
Location: Italy, Ciampino (Rome)

Post by cpighin » Wed Dec 08, 2010 1:13 pm

:) thanks dimesio.

I have done following actions:

1) I followed this guide to uninstall again Birthday Reminder: http://wiki.winehq.org/FAQ#head-8a17a13 ... aaf043d581

Code: Select all

claudio@Aspire-8530:~$ rm -rf $HOME/.wine
claudio@Aspire-8530:~$ rm -f $HOME/.config/menus/applications-merged/wine*
claudio@Aspire-8530:~$ rm -rf $HOME/.local/share/applications/wine
claudio@Aspire-8530:~$ rm -f $HOME/.local/share/desktop-directories/wine*
claudio@Aspire-8530:~$ rm -f $HOME/.local/share/icons/????_*.{xpm,png}
claudio@Aspire-8530:~$ rm -f $HOME/.local/share/icons/*-x-wine-*.{xpm,png}
claudio@Aspire-8530:~$ 
2) I verified that folder .wine was removed and that Birthday Reminder was no more listed in the system menu.
3) I uninstalled again wine1.3 by package manager and verified that was not listed in the system menu.
4) I installed again wine1.3 (resulted as version 1.3.8 ) by package manager.
5) I verified that Wine was again in the system menu, that Birthday Reminder was not present, that folder .wine was not created.

Now, before doing wrong actions, I wait for your guide, dimesio :), to go further, if you retain that all things are OK.

Claudio :)

cpighin
Level 2
Level 2
Posts: 30
Joined: Sat Dec 04, 2010 12:51 pm
Location: Italy, Ciampino (Rome)

Post by cpighin » Thu Dec 09, 2010 5:20 am

:) Waiting for advises on how to proceed safely, I configured Wine following this guide http://www.winehq.org/docs/wineusr-guid ... NG-WINECFG.

I noticed that folder /home/claudio/.wine was created at winecfg startup.
I copied files bdaysetup.exe (application setup ) e bday.exe (application) in the folder /home/claudio/.wine/drive_c/Programmi to prepare Birthday Reminder installation.
I set following parameters in WINECFG:
- Tab Applications > Predefined setting > Windows version: Windows7
- Tab Applications > file /home/claudio/.wine/drive_c/Programmi/bday.exe > Windows version: WindowsXP
- Tab Units > automatically detect
I verificied the absence of folder Birthday Reminder within Wine menu

Now I should install the application Birthday Reminder. Any suggestion on the best way to follow to avoid previous errors?

Claudio :)

User avatar
dimesio
Moderator
Moderator
Posts: 12671
Joined: Tue Mar 25, 2008 10:30 pm

Post by dimesio » Thu Dec 09, 2010 9:29 am

- Tab Applications > Predefined setting > Windows version: Windows7
Why did you change this? Don't change default settings without a reason.
Now I should install the application Birthday Reminder. Any suggestion on the best way to follow to avoid previous errors?
Don't run as sudo, and use winetricks to install mfc42.

cpighin
Level 2
Level 2
Posts: 30
Joined: Sat Dec 04, 2010 12:51 pm
Location: Italy, Ciampino (Rome)

Again mfc42.dll error

Post by cpighin » Thu Dec 09, 2010 11:05 am

:) I waited for several hours and no help arrived, so I installed Birthday Reminder with double-click on file /home/claudio/.wine/dosdevices/c:/Programmi/bdaysetup.exe as instructed by this guide http://wiki.winehq.org/FAQ#head-497f1a2 ... 2c7767afa2
Birthday Reminder setup did the following:
- created a folder /home/claudio/.wine/dosdevices/c:/Programmi/Birthday Reminder contening files bday.exe (the excutable for the application) and instlog.lsl
- inserted a folder and and its dedicated launchers (Applications> Wine> Programs> Birthday Reminder> Setup / Check now) into Wine menu.
Than I tried to run Birthday Reminder by terminal command and I had the same result as msg#1.

Code: Select all

claudio@Aspire-8530:~$ wine "c:\\Programmi\\Birthday Reminder\\bday.exe" 
err:module:import_dll Library MFC42.DLL (which is needed by L"C:\\Programmi\\Birthday Reminder\\bday.exe") not found
err:module:LdrInitializeThunk Main exe initialization for L"C:\\Programmi\\Birthday Reminder\\bday.exe" failed, status c0000135
What is wrong now? Please help me!

Claudio :)

User avatar
dimesio
Moderator
Moderator
Posts: 12671
Joined: Tue Mar 25, 2008 10:30 pm

Re: Again mfc42.dll error

Post by dimesio » Thu Dec 09, 2010 11:37 am

cpighin wrote:

Code: Select all

claudio@Aspire-8530:~$ wine "c:\\Programmi\\Birthday Reminder\\bday.exe" 
err:module:import_dll Library MFC42.DLL (which is needed by L"C:\\Programmi\\Birthday Reminder\\bday.exe") not found
Install mfc42 with winetricks.

cpighin
Level 2
Level 2
Posts: 30
Joined: Sat Dec 04, 2010 12:51 pm
Location: Italy, Ciampino (Rome)

Now mfc42.dll error has been solved

Post by cpighin » Thu Dec 09, 2010 12:12 pm

:) Thanks dimesio.

I installed mfc42.dll by winetricks

Code: Select all

claudio@Aspire-8530:~$ sh winetricks
Executing wget -O vc6redistsetup_enu.exe -nd -c --read-timeout=300 --retry-connrefused --header Accept-Encoding: gzip,deflate http://download.microsoft.com/download/vc60pro/update/1/w9xnt4/en-us/vc6redistsetup_enu.exe
--2010-12-09 17:45:57--  http://download.microsoft.com/download/vc60pro/update/1/w9xnt4/en-us/vc6redistsetup_enu.exe
Risoluzione di download.microsoft.com... 213.199.149.182, 213.199.149.183
Connessione a download.microsoft.com|213.199.149.182|:80... connesso.
HTTP richiesta inviata, in attesa di risposta... 200 OK
Lunghezza: 1833232 (1,7M) [application/octet-stream]
Salvataggio in: "vc6redistsetup_enu.exe"

100%[======================================>] 1.833.232    741K/s   in 2,4s    

2010-12-09 17:45:59 (741 KB/s) - "vc6redistsetup_enu.exe" salvato [1833232/1833232]

Executing wine /home/claudio/.cache/winetricks/vc6redistsetup_enu.exe /T:C:\winetrickstmp /c
Executing /usr/bin/cabextract /home/claudio/.cache/winetricks/vcredist.exe -d /home/claudio/.wine/dosdevices/c:/windows/system32 -F mfc42u.dll
/home/claudio/.cache/winetricks/vcredist.exe: library not compiled to support large files.
Extracting cabinet: /home/claudio/.cache/winetricks/vcredist.exe
  extracting /home/claudio/.wine/dosdevices/c:/windows/system32/mfc42u.dll

All done, no errors.
Using native,builtin override for following DLLs: msvcrt
Executing early_wine regedit c:\winetrickstmp\override-dll.reg
REGEDIT4

[HKEY_CURRENT_USER\Software\Wine\DllOverrides]
"*msvcrt"="native,builtin"
Install of mfc42 done
winetricks done.
claudio@Aspire-8530:~$ 
Than I cheched that mfc42u.dll was installed in /home/claudio/.wine/dosdevices/c:/windows/system32 and that there was also mfc42.dll

Than I tried again to run Birthday Reminder and ... it worked as expected :D even if with a fixme issue that I don't undestand.

Code: Select all

claudio@Aspire-8530:~$ wine "c:\\Programmi\\Birthday Reminder\\bday.exe" 
fixme:ole:DllRegisterServer stub
claudio@Aspire-8530:~$ 
dimesio, should I do something else to improve the system behaviour?

Claudio :)

cpighin
Level 2
Level 2
Posts: 30
Joined: Sat Dec 04, 2010 12:51 pm
Location: Italy, Ciampino (Rome)

Running Birdthday Remainders

Post by cpighin » Mon Dec 13, 2010 9:58 am

:) Those interested on running Birthday Remainders in Ubuntu/Wine should read this:

http://appdb.winehq.org/objectManager.p ... ngId=59584

Claudio :)

cpighin
Level 2
Level 2
Posts: 30
Joined: Sat Dec 04, 2010 12:51 pm
Location: Italy, Ciampino (Rome)

Post by cpighin » Sat Feb 05, 2011 9:33 am

:) Hi experts, hi dimesio

Few days ago Wine/Birthday Reminders stopped to run. I suppose that it is a consequence of an automatic updating of Ubuntu and I ask an advice on the best way to solve the issue.

Consider that:
  • if I run the application clicking on it, as usual, I see the system working and stopping after tens of seconds,
    If I run the application by console, this is the code that I get

Code: Select all

claudio @ Aspire-8530: ~ $ wine "c:\\Programmi\\Birthday Reminder\\bday.exe" 
The program "wine"can be found in the following packages:
* wine1.2
* wine1.0
Try: sudo apt-get install <package selected>
Consider also that Wine 1.3 is listed as loaded in Package Manager!

Claudio :)

User avatar
dimesio
Moderator
Moderator
Posts: 12671
Joined: Tue Mar 25, 2008 10:30 pm

Post by dimesio » Sat Feb 05, 2011 10:52 am

cpighin wrote: If I run the application by console, this is the code that I get[/list]

Code: Select all

claudio @ Aspire-8530: ~ $ wine "c:\\Programmi\\Birthday Reminder\\bday.exe" 
The program "wine"can be found in the following packages:
* wine1.2
* wine1.0
Try: sudo apt-get install <package selected>
Consider also that Wine 1.3 is listed as loaded in Package Manager!
Well, I'd try uninstalling then reinstalling Wine. If that doesn't fix it, ask on your distro's support forum. This appears to be a package manager issue.

cpighin
Level 2
Level 2
Posts: 30
Joined: Sat Dec 04, 2010 12:51 pm
Location: Italy, Ciampino (Rome)

Post by cpighin » Mon Feb 07, 2011 11:46 am

:) Thanks dimesio,

I did what suggested and now Birthday Remainder 1.60 works properly again and this could confirm the hypothesis of a package manager issue as the cause of the problem reported above.

For those interested, hereunder is the list of actions taken to run the application.
  • 1) Following this guide I un-installed Birthday Remainder and Wine (not Winetricks) by Package Manager,
    2) I installed wine1.3-8 by Package Manager (later I found that were installed: wine1.3, wine1.3-gecko, winetricks).
    3) I configured Wine by the graphic tool as follow:
    - Applications Tab> Predefined setting> Windows version: Windows 7
    - Drives Tab> "Automatically detect"
    4) Than I tried to install Birthday Remainder 1.60 (bday_setu.exe) opening the executable program in various ways without success. When I did it with the console command "wine bday_setup.exe", I verified that the system required a correct installation of the library MFC42.DLL. Note that in the past this error occurred after the installation!
    5) I installed the library MFC42.DLL with the command "winetricks" (instead of "sh winetricks" since the package was jet installed) followed by selection of the library in the list that was shown.
    6) Than I had success on installing Birthday Reminder 1.60 by double-clicking on the file "wine bday_setup.exe" on the desktop and I proved that the application was running by console command and by one of the two dedicated launchers within Wine.
    7) In order to run Birthday Reminder in Ubuntu environment referring to the same file as in Windows, I created a symbolic link to /media/ACER_WIN7/Users/claudio/Dati applicazioni/Zhorn Birthday Reminder/bdays.ini, inside folder "/home/claudio/.wine/drive_c/users/claudio/Applicazioni/Zhorn Birthday Reminder" and I renamed it "bdays.ini.
    8 ) Finally I checked that the application was working properly.
Thanks again dimesio, Claudio :)

cpighin
Level 2
Level 2
Posts: 30
Joined: Sat Dec 04, 2010 12:51 pm
Location: Italy, Ciampino (Rome)

Post by cpighin » Thu May 03, 2012 7:36 am

:D For those interested, hereunder is the list of actions taken to run the application after the installation of Birthday Reminder 1.61 on Ubuntu 12.04
  • 1) I installed wine by Package Manager which installed also: wine-gecko1.4, wine-gecko1.4:i386, wine1.4, wine1.4-amd64, wine1.4-common, wine1.4-i386:i386, winetricks.
    2) I verified that Wine was listed in Application menu
    3) I configured Wine by the graphic tool as follow:
    - Applications Tab> Predefined setting> Windows version: Windows 7
    - Drives Tab> "Automatically detect"
    click on Apply, than OK
    4) I installed the necessary library MFC42.DLL by terminal and command "winetricks mfc42" (after few seconds window "VCRedist Installation" popped up to request confirmation for Licence Agreement and after this library /home/claudio/.wine/drive_c/windows/syswow64/mfc42.dll was installed).
    5) Than I had success on installing Birthday Reminder 1.61 by opening its setup program with Wine.
    6) I proved that the application was running by console command and by one of the two dedicated launchers within Wine.
    7) In order to run Birthday Reminder in Ubuntu environment as well as in Windows (referring to the same file as in Windows), I created a symbolic link in "/home/claudio/.wine/drive_c/users/claudio/Application Data/Zhorn Birthday Reminder/bdays.ini", to file "/home/claudio/.wine/drive_c/users/claudio/Application Data/Zhorn Birthday Reminder/bdays.ini" which contain application data.
    8 ) Finally I checked that the application was working properly in both systems.
Claudio :D

Locked