davidgfnet / whatsapp-purple

WhatsApp protocol implementation for libpurple (pidgin)
856 stars 211 forks source link

libwhatsapp.dll is not loadable #229

Open decal08 opened 9 years ago

decal08 commented 9 years ago

Hi,

Upon start of pidgin, the following was encountered (20:34:10) plugins: probing C:\Program Files (x86)\Pidgin\plugins\libwhatsapp.dl l (20:34:10) plugins: C:\Program Files (x86)\Pidgin\plugins\libwhatsapp.dll is not loadable: `C:\Program Files (x86)\Pidgin\plugins\libwhatsapp.dll': %1 is not a valid Win32 application.

Win7 64bit libpurple 2.10.11 Pidgin 2.10.11

whatsapp is not shown in protocol when creating a new account

davidgfnet commented 9 years ago

You may send me the dll over email and I'll check. It seems weird.

decal08 commented 9 years ago

Sent. (replied to all in the generated mail notification)

Thanks!

davidgfnet commented 9 years ago

Uhm I don't think that works... Send me an email to my personal address :)

decal08 commented 9 years ago

Lol sorry about that. What email address should I address it to? (can't seem to find your personal email)

gnottgen commented 9 years ago

I have the same problem. Git log says, that the libwhatsapp.dll in the repository is from November 2014 - would you be so nice and provide a current compiled version, or do i have to compile it myself?

Edit: Tried to compile it by myself -> same errors as in https://github.com/davidgfnet/whatsapp-purple/issues/260: process_begin: CreateProcess(NULL, mingw32-pkg-config --variable=plugindir purple, ...) failed. process_begin: CreateProcess(NULL, mingw32-pkg-config --variable=datarootdir purple, ...) failed. process_begin: CreateProcess(NULL, mingw32-pkg-config --cflags purple, ...) failed. i686-w64-mingw32-gcc -c -std=c++11 -Wno-unused-parameter -O2 -m32 -Wall -Wextra -fPIC -DPURPLE_PLUGINS -DPIC -I "/pidgin/libpurple/" -I "/win32-dev/gtk_2_0-2.14/include/glib-2.0/" -I "/win32-dev/gtk_2_0-2.14/lib/glib-2.0/include/" -o wa_purple.o wa_purple.c "C:/Program Files (x86)/Git/bin/sh.exe": i686-w64-mingw32-gcc: command not found Makefile.mingw:48: recipe for target 'wa_purple.o' failed make: * [wa_purple.o] Error 127**

davidgfnet commented 9 years ago

AFAIK the dll has never been ib the repo. There is a symlink to help NSIS builder.

gnottgen commented 9 years ago

OK - for everyone, that also tries to compile whatsapp-purple by himself: checkout https://github.com/Stenkelfled/whatsapp-purple There I have added an HOWTO-compile with some hints. (if i now knew the password to my account i could connect -_- )

Lexoka commented 9 years ago

Thank you. I believe I've completed all the steps correctly but I still can't make. Specifically, MinGW can't find the first header, account.h. This is odd, because the Makefile seems to have the right includes, and the header in question is indeed in pidgin\libpurple\.

Perhaps I didn't set up MinGW properly?

It might be better to just upload the dll somewhere—that's a lot of trouble to go through just to install a plugin.

ps2reality commented 9 years ago

I have the same problem : " wa_purple.c:41:21: fatal error: account.h: No such file or directory

include "account.h"

"

gnottgen commented 9 years ago

yeah - i think, you have to add you working path to PIDGIN_DEV_ROOT variable. Sorry for that. (otherwise check you include directories in the Makefile)

Lexoka commented 9 years ago

Better! But still no cigar. I now get an error stating that "_hypot was not declared in this scope" for math.h. This suggested that it is a bug in MinGW and that adding -D__NO_INLINE__ to the compiler's options (so CFLAGS, I guess) would solve it, and I think it may have.

But I get a new error:

mingw32-windres libwhatsapp.rc -O coff -o libwhatsapp.res
process_begin: CreateProcess(NULL, mingw32-windres libwhatsapp.rc -O coff -o libwhatsapp.res, ...) failed.
make (e=2): The system cannot find the file specified.
Makefile:61: recipe for target 'libwhatsapp.res' failed
mingw32-make: *** [libwhatsapp.res] Error 2
gnottgen commented 9 years ago

as the error sais: the program mingw32-windres is missing. But as this is open source i put the compiled dll in my repo. have fun!

Lexoka commented 9 years ago

Indeed. I thought the file specified referred to a source file. For some reason I don't have mingw32-windres.exe and it doesn't appear in the MinGW Installation Manager, but I do have windres.exe, so I tried to use that instead, and had to do the same for strip, but then I just got a "nothing to do for all" message, for some reason.

So I tried to just download your repo and compile the installer.nsi script, which generated an installer that seemed to work, but actually didn't. It failed to create a loadable module (I think it didn't even copy the DLLs properly.

Now I don't have that log, because at first I thought the script had worked so I didn't save it, but if I run it now I get this:

...
WriteRegStr: HKLM\SOFTWARE\whatsapp4pidgin\pidgindir=$PidginDir
FunctionEnd
Function: "UnInstOld"
Push: $0
ReadRegStr $0 HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\whatsapp4pidgin\UninstallString
IfFileExists: "$0" ? deinst : cont
MessageBox: 48: "whatsapp4pidgin was already found on your system and will first be uninstalled"
ClearErrors
ExecWait: ""$0" _?=$INSTDIR" (->)
IfErrors ?0:cont
MessageBox: 48: "Uninstall failed or aborted"
Abort: "Uninstalling of the previous version gave an error. Install aborted."
FunctionEnd
Function: "CopyDLL"
SetOverwrite: try
ClearErrors
IfFileExists: "$PidginDir\plugins\$DllName" ? 0 : copy
Delete: "$PidginDir\plugins\$DllName"
ClearErrors
Rename: $INSTDIR\$DllName->$PidginDir\plugins\$DllName
IfErrors ?dllbusy:
Return
MessageBox: 5: "$DllName is busy. Please close Pidgin (including tray icon) and try again" (on IDCANCEL goto cancel)
Delete: "$PidginDir\plugins\$DllName"
Goto: copy
Return
Abort: "Installation of whatsapp4pidgin aborted"
FunctionEnd

Processed 1 file, writing output (x86-ansi):
Adding plug-ins initializing function... Done!
Processing pages... Done!
Removing unused resources... Done!
Generating language tables... Done!
Generating uninstaller... Done!

Output: "E:\dev\whatsapp-purple-master\win32\whatsapp4pidgin-0.8.1.exe"
Install: 4 pages (256 bytes), 3 sections (2 required) (6216 bytes), 340 instructions (9520 bytes), 184 strings (3408 bytes), 1 language table (302 bytes).
Uninstall: 1 page (128 bytes), 1 section (2072 bytes), 64 instructions (1792 bytes), 89 strings (1749 bytes), 1 language table (226 bytes).

Using zlib compression.

EXE header size:               68608 / 35840 bytes
Install code:                   3431 / 17070 bytes
Install data:                 471760 / 1881370 bytes
Uninstall code+data:           11094 / 15413 bytes
CRC (0x4CE639DE):                  4 / 4 bytes

Total size:                   554897 / 1949697 bytes (28.4%)

The highlights of which are:

MessageBox: 48: "whatsapp4pidgin was already found on your system and will first be uninstalled"
MessageBox: 48: "Uninstall failed or aborted"
Abort: "Uninstalling of the previous version gave an error. Install aborted."
MessageBox: 5: "$DllName is busy. Please close Pidgin (including tray icon) and try again" (on IDCANCEL goto cancel)
Abort: "Installation of whatsapp4pidgin aborted"

The thing is, Pidgin is not running. I tried uninstalling it and reinstalling it, to no avail. I tried rebooting, deleting the DLL manually… I always get this error, even if the DLL isn't even present in the Pidgin\plugins folder. I have to admit this is starting to drive me slightly insane.

One time the installer copied the DLL as it should have, but Pidgin still wasn't happy:

(00:07:13) plugins: G:\Program Files (x86)\Pidgin\plugins\libwhatsapp.dll is not loadable: `G:\Program Files (x86)\Pidgin\plugins\libwhatsapp.dll': The specified module could not be found.

But in any case, thank you for your very helpful and patient assistance!

ps2reality commented 9 years ago

I found this tutorial about compiling lipwhatsapp.dll http://pastebin.com/KcaNJeCN

Lexoka commented 9 years ago

As far as I can tell, the libwhatsapp.dll in Stenkelfled's repository was compiled just fine, but the installer script keeps telling me that it can't be installed in Pidgin\plugins because it's supposedly already there and busy. It tells me that even if I delete it manually. I have no idea what could be causing this.

gnottgen commented 9 years ago

No idea, what might be wrong. Try to copy the dll by yourself.

Lexoka commented 9 years ago

That's what I tried first, but Pidgin said the DLL was non loadable, that there was no associated module, something like that (I'll try it again when I have access to the machine to get the exact error message). I suppose copying the DLL isn't enough and I need to create a new folder with some of the whatsapp plugin's files.

I suspect that messing around with the files manually is precisely what's preventing the install script from working properly, but I don't know why.

That said, the script contains references to two DLLs, libwhatsapp.dll and whatsapp-pidgin-plugin.dll. I don't understand what the second one is, or whether I actually need it, but I don't have it.

Lexoka commented 9 years ago

I should mention that while compiling the NSIS script generates errors, it also does generate an installer .exe that does seem to do at least some of what it's supposed to, including copying libwhatsapp.dll in the plugins directory.

However, when I launch Pidgin I still get:

(20:31:01) plugins: G:\Program Files (x86)\Pidgin\plugins\libwhatsapp.dll is not loadable: `G:\Program Files (x86)\Pidgin\plugins\libwhatsapp.dll': The specified module could not be found.

And indeed, the plugin does not work. By the way, Perl doesn't work either for some reason. Does the whatsapp plugin rely on Perl in any way?

ps2reality commented 9 years ago

I have the same problem, even i try to copy the dll to the plugins folder, but pidgin report "libwhatsapp.dll is not loadable". If i replace the libwhatsapp.dll 0.8.1 for the libwahtsapp.dll 0.7.0 in the same plugins folder, pidgin works ok, the libwhatsapp.dll is loaded and whatsapp working just fine, BUT, with the reconnect bug of version 0.7.0.

gnottgen commented 9 years ago

Sorry guys. I can't repoduce this issues. The Installer worked for me. And if the dll is ok, it also should work, if you copy it to the plugin folder. But another question: can i use whatsapp with pidgin and on my phone the same time?

nathandh commented 9 years ago

If you are experiencing (in a Windows environment) the "...libwhatsapp.dll is not loadable.....libwhatsapp.dll': The specified module could not be found." error.... It could be from a failure in being able to locate the required FreeImage.dll library on load (as the plugin fairly recently switched to using FreeImage). --Try placing the distributed FreeImage.dll in your Pidgin program directory. Such as at: C:\Program Files (x86)\Pidgin\FreeImage.dll. I tested this under a Windows 8.1 x64 environment, and it resolved the previous error and allowed the compiled libwhatsapp plugin to load correctly.

Note: Removing the FreeImage.dll, and launching Pidgin with debug info reproduces the error consistently. ---*This is without using any installer, and just compiling from source and manually placing the libwhatsapp.dll under the pidgin plugins directory.

Lexoka commented 9 years ago

That worked! I had almost given up on this, thanks a lot!

Unfortunately I can't answer Stenkelfled's question, as I don't have a phone that supports Whatsapp.