Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Windows binaries #125

Closed
nijel opened this issue Aug 18, 2015 · 25 comments
Closed

Build Windows binaries #125

nijel opened this issue Aug 18, 2015 · 25 comments

Comments

@nijel
Copy link
Member

nijel commented Aug 18, 2015

Gammu lacks Windows builds for quite some time. I'm making source only release, which works fine on Linux or OSX, but I don't have any Windows system to produce Windows binaries. Also I lack experience with Windows toolchain to be able to do this effectively. Thus somebody else is needed to produce the Windows binaries. It should not be hard, the build system is ready, at most it will need some minor adjustments.

See also https://blog.cihar.com/archives/2014/12/31/no-windows-builds-gammu-and-wammu/

@nijel nijel added the windows label Aug 18, 2015
@Armagetron
Copy link
Contributor

I have successfully build gammu for windows. This is the cmake log:

-- Building for: Visual Studio 14 2015
-- The C compiler identification is MSVC 19.0.23026.0
-- Check for working C compiler using: Visual Studio 14 2015
-- Check for working C compiler using: Visual Studio 14 2015 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Configuring Gammu 1.36.7
-- Could NOT find PkgConfig (missing:  PKG_CONFIG_EXECUTABLE)
-- Could NOT find PkgConfig (missing:  PKG_CONFIG_EXECUTABLE)
-- Could NOT find Doxygen (missing:  DOXYGEN_EXECUTABLE)
-- Looking for __clang__
-- Looking for __clang__ - not found
-- Looking for strncasecmp
-- Looking for strncasecmp - not found
-- Looking for strcasecmp
-- Looking for strcasecmp - not found
-- Looking for _strnicmp
-- Looking for _strnicmp - found
-- Looking for _stricmp
-- Looking for _stricmp - found
-- Looking for strcasestr
-- Looking for strcasestr - not found
-- Looking for strchrnul
-- Looking for strchrnul - not found
-- Looking for strtoull
-- Looking for strtoull - found
-- Looking for dirent.h
-- Looking for dirent.h - not found
-- Looking for sys/ioctl.h
-- Looking for sys/ioctl.h - not found
-- Looking for sys/utsname.h
-- Looking for sys/utsname.h - not found
-- Looking for unistd.h
-- Looking for unistd.h - not found
-- Looking for wchar.h
-- Looking for wchar.h - found
-- Looking for include files wchar.h, wctype.h
-- Looking for include files wchar.h, wctype.h - found
-- Looking for iswspace
-- Looking for iswspace - found
-- Looking for towlower
-- Looking for towlower - found
-- Looking for I_SETSIG
-- Looking for I_SETSIG - not found
-- Looking for strings.h
-- Looking for strings.h - not found
-- Looking for scandir
-- Looking for scandir - not found
-- Looking for alphasort
-- Looking for alphasort - not found
-- Looking for getopt
-- Looking for getopt - not found
-- Looking for getopt_long
-- Looking for getopt_long - not found
-- Looking for daemon
-- Looking for daemon - not found
-- Looking for daemon
-- Looking for daemon - not found
-- Looking for kill
-- Looking for kill - not found
-- Looking for getpwnam
-- Looking for getpwnam - not found
-- Looking for getgrnam
-- Looking for getgrnam - not found
-- Looking for getpwuid
-- Looking for getpwuid - not found
-- Looking for getuid
-- Looking for getuid - not found
-- Looking for initgroups
-- Looking for initgroups - not found
-- Looking for setuid
-- Looking for setuid - not found
-- Looking for setgid
-- Looking for setgid - not found
-- Looking for SIGHUP
-- Looking for SIGHUP - not found
-- Looking for SIGUSR1
-- Looking for SIGUSR1 - not found
-- Looking for SIGUSR2
-- Looking for SIGUSR2 - not found
-- Looking for dup
-- Looking for dup - not found
-- Looking for getpid
-- Looking for getpid - not found
-- Looking for getpass
-- Looking for getpass - not found
-- Looking for alarm
-- Looking for alarm - not found
-- Looking for dup
-- Looking for dup - found
-- Looking for shmget
-- Looking for shmget - not found
-- Performing Test HAVE_STRPTIME
-- Performing Test HAVE_STRPTIME - Failed
-- Performing Test HAVE_SYSLOG
-- Performing Test HAVE_SYSLOG - Failed
-- Looking for pthread.h
-- Looking for pthread.h - not found
-- Found Threads: TRUE
-- Found PythonInterp: G:/Python2/python.exe (found suitable version "2.7.10", m
inimum required is "2")
-- MySQL not found.
-- Found ODBC: C:/Program Files (x86)/Windows Kits/8.1/Lib/winv6.3/um/x86/odbc32
.lib
-- Could not find PostgreSQL
-- libdbi not found.
-- Could NOT find Libintl (missing:  LIBINTL_INCLUDE_DIR LIBINTL_LIB_FOUND)
-- Could NOT find CURL (missing:  CURL_LIBRARY CURL_INCLUDE_DIR)
-- Could NOT find PkgConfig (missing:  PKG_CONFIG_EXECUTABLE)
-- Could NOT find PkgConfig (missing:  PKG_CONFIG_EXECUTABLE)
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of wchar_t
-- Check size of wchar_t - done
-- Check size of wint_t
-- Check size of wint_t - done
-- Check size of ssize_t
-- Check size of ssize_t - failed
-- Check size of intptr_t
-- Check size of intptr_t - done
-- Performing Test HAVE_MACRO_FUNCTION
-- Performing Test HAVE_MACRO_FUNCTION - Success
-- Performing Test HAVE_STRUCT_TM_TM_ZONE
-- Performing Test HAVE_STRUCT_TM_TM_ZONE - Failed
-- Performing Test HAVE_DAYLIGHT
-- Performing Test HAVE_DAYLIGHT - Failed
-- Performing Test HAVE_MACRO_FUNC
-- Performing Test HAVE_MACRO_FUNC - Failed
-- Using Windows native Bluetooth
-- Bluetooth support enabled
-- Searching for RF channels with Bluetooth stack enabled
-- libusb-1.0 not found.
-- Using Windows native IrDA
-- IrDA support enabled
-- Performing Test COMPILER_HAS_W3
-- Performing Test COMPILER_HAS_W3 - Success
-- Nokia support enabled
-- Nokia MBUS2 protocol enabled
-- Nokia FBUS2 protocol enabled
-- Nokia FBUS2DLR3 protocol enabled
-- Nokia DKU2PHONET protocol enabled
-- Nokia DKU2AT protocol enabled
-- Nokia DKU5FBUS2 protocol enabled
-- Nokia FBUS2PL2303 protocol enabled
-- Nokia FBUS2BLUE protocol enabled
-- Nokia PHONETBLUE protocol enabled
-- Nokia BLUEFBUS2 protocol enabled
-- Nokia BLUEPHONET protocol enabled
-- Nokia IRDAPHONET protocol enabled
-- Nokia FBUS2IRDA protocol enabled
-- Nokia 3320 and compatible phones support enabled
-- Nokia 650 and compatible phones support enabled
-- Nokia 61xx and compatible phones support enabled
-- Nokia 6510 and compatible phones support enabled
-- Force using 6210 frames for calendar for DCT4 phones disabled
-- Nokia 7110 and compatible phones support enabled
-- Nokia 9210 and compatible phones support enabled
-- Nokia 3650 and compatible phones support enabled
-- AT support enabled
-- AT protocol enabled
-- AT protocol over Bluetooth enabled
-- AT protocol over IrDA enabled
-- AT phones support enabled
-- Alcatel support enabled
-- Alcatel protocol enabled
-- Alcatel phones support enabled
-- OBEX compatible phones support enabled
-- OBEX protocol over Bluetooth enabled
-- OBEX protocol over IrDA enabled
-- Generic OBEX phones support enabled
-- AT with OBEX phones support enabled
-- Symbian phones support (S60) enabled
-- Symbian phones support (gnapplet) enabled
-- GNAPBUS protocol over Bluetooth enabled
-- GNAPBUS protocol over IrDA enabled
-- Gnapplet phones support enabled
-- S60 phones support enabled
-- Cell Broadcast messages support enabled
-- Backup/Restore functions enabled
-- Performing Test COMPILER_HAS_WWRITE_STRINGS
-- Performing Test COMPILER_HAS_WWRITE_STRINGS - Failed
-- Performing Test COMPILER_HAS_WREDUNDANT_DECLS
-- Performing Test COMPILER_HAS_WREDUNDANT_DECLS - Failed
-- Found message compiler: C:/Program Files (x86)/Windows Kits/8.1/bin/x86/mc.ex
e
-- Init script not being installed, install it by -DINSTALL_LSB_INIT=ON
-- Udev rules not being installed, install it by -DINSTALL_UDEV_RULES=ON
-- Configuring done
-- Generating done
-- Build files have been written to: G:/Projects/gammu/build

I am not sure whether MySQL/PostgreSQL support is present in my current configuration. If not, I will try to add this. The same with any other optional dependency.

I had to make two changes to the code (Armagetron/gammu@ee3ad0d). I have not tested whether they break compilation on other platforms. But if not, I can create a pull request.

If anyone wants to test my binaries, they can be downloaded from: https://armagetron.de/Gammu-64a0c94.tar.bz2
It may be possible that you need the Microsoft Visual C++ 2015 Redistributable (x86) for them to work.

@nijel
Copy link
Member Author

nijel commented Nov 23, 2015

Thanks, I think your changes look okay, I've just merged them.

@Armagetron
Copy link
Contributor

I should add that these changes are for Visual Studio. If anyone wants to build with mingw, the *_s may not be present.

@nijel
Copy link
Member Author

nijel commented Nov 23, 2015

The build with MinGW is even less tested than the MSVC one (I've tested
MSVC myself some time ago, but some recent changes broke that)...

@anggalisdiyanto
Copy link

I was generated a Visual Studio 2015 project solution of Gammu 1.37.0 by using cmake, then bulid it with Visual Studio 2015. I open the gammu.sln and then rebuild the project called BUILD_ALL and wait several minute until done. I have nothing error, all is fine.

I just confuse how to replace old files (Gammu 1.33.0) with new one (compiled Gammu 1.37.0).

I got several executeable files and pkgconfig folder with files inside it from each project folders (inside of build folder in each project folders), then copying it into an old Gammu (1.33.0).

The result is, i cannot start the service.

These files was deleted and now i am using Gammu 1.33.0, so i am so sorry cannot give some of screenshoots.

I am stil remember, it generate an error mesage like this :

Error 0 : The service was started successfully
(failed to start gammu service)

@nijel
Copy link
Member Author

nijel commented Mar 4, 2016

Does the program start from commandline? If not, then there are some missing DLLs.

If it does start, then it's most likely problem with finding config file. Anyway this is a bit offtopic in this issue...

@anggalisdiyanto
Copy link

It cannnot started from command line.
And from Windows's apps services.msc, when i start the service it generate an error message like this :

Error 1053: The service did not respond to the start or control request in a timely fashion

Sorry, but i got this URL's issue after i am ask about Gammu version on Windows from mailing list.
I think, i can discuss about it. Sorry again...

@nijel
Copy link
Member Author

nijel commented Mar 4, 2016

And what's the error from the commandline?

@anggalisdiyanto
Copy link

Error 0 : The service was started successfully
(failed to start gammu service)

From Gammu's documentation, the Error 0 mean is nothing error refference to show.
But not problem, maybe i just using Gammu 1.33.0.
Or if Mr. Nijel did not mind, i will send an URL link of compiled folder here.

@nijel
Copy link
Member Author

nijel commented Mar 5, 2016

I meant without trying to use it as service, starting it directly.

Compiled files won't be any use for me, I don't have Windows ;-).

@nijel
Copy link
Member Author

nijel commented May 11, 2016

BTW: You can add bounty on this issue and that might motivate somebody to work on it (eventually it might even motivate me to learn how to do work with Visual Studio and related tools).

@Armagetron
Copy link
Contributor

@anggalisdiyanto : Did you stop the service before copying the files? As @nijel already asked: does the compiled binary run directly from command-line?

In Visual Studio should be an "Install" target. This should replace the old binaries.

@nijel
Copy link
Member Author

nijel commented Aug 21, 2016

Thanks to AppVeyor I've set up CI solution for Windows. It also produces installer images. Current binaries are available here:

Testing is welcome as I'm doing this completely without Windows :-). Please let me know what is broken there or what is missing. Thanks!

@Armagetron
Copy link
Contributor

I'm currently on vacation but I will check this next week.

@nijel
Copy link
Member Author

nijel commented Aug 22, 2016

More up to date build (with fixed several Windows specific bugs):

Testsuite now passes, so it should more or less work fine. Maybe some bundled libraries will be missing...

@nijel
Copy link
Member Author

nijel commented Sep 8, 2016

Okay, there seems to be some problems to solve: #236

@nijel
Copy link
Member Author

nijel commented Oct 10, 2016

@wehaye
Copy link

wehaye commented Oct 12, 2016

Hi Mr. Nijel.

I tried to compile gammu use cross compile from ubuntu to windows.
I successfully made gammu.exe and gammu-smsd.exe.
But I have not tried is successfully used because I wear a mysql database. Because I'm confused how to include MySQL backend service for windows.

Btw, gammu Installer for Windows version above does not include mysql.
I typed syntax gammu-smsd -v, backend service that appears only odbc
Please add mysql backend to the installer.
Thanks.

@Armagetron
Copy link
Contributor

Hi @wehaye : You can install the ODBC driver for mysql.

@nijel
Copy link
Member Author

nijel commented Oct 12, 2016

Neither MySQL nor PostgreSQL will not be natively supported in forseable future on Windows. The problem is that each official binary depends on different MSVC runtime and it's not possible to mix them. Also each of them link to different versions of other libraries leading to even bigger dll mess. The option would be to build client libraries ourselves, but that's really too much effort for something which can be solved by installing ODBC driver.

@wehaye
Copy link

wehaye commented Oct 12, 2016

Yes, you are right.
The easiest option is to install the ODBC driver, and I've done. the results are successful. Both gammu.exe and gammu-smsd.exe can run normally.

I gave a little bit of information that if there are people who try to connect gammu-smsd using the ODBC driver ("gammu-smsd -i -c smsdrc" then "gammu-smsd -s -c smsdrc") and got an error message and fail, but when you try gammu-smsd run without install ("gammu-smsd -c smsdrc") succeeds, make sure that you create an ODBC connection via the "system DSN" not "user DSN".

Thank you very much sir Nijel

@nijel
Copy link
Member Author

nijel commented Oct 12, 2016

Can you please improve our ODBC documentation to cover all problems you've faced? It's in https://github.com/gammu/gammu/blob/master/docs/manual/smsd/odbc.rst

Thanks!

@wehaye
Copy link

wehaye commented Oct 14, 2016

Sorry, my English is not good.
I just use google translate to translate.
So afraid misleading.

@nijel
Copy link
Member Author

nijel commented Oct 14, 2016

Don't worry to submit something, we can improve English later...

@nijel
Copy link
Member Author

nijel commented Oct 18, 2016

1.37.90 comes with Windows binaries: https://wammu.eu/download/gammu/1.37.90/

@nijel nijel closed this as completed Oct 18, 2016
@nijel nijel self-assigned this Oct 18, 2016
nijel added a commit that referenced this issue Oct 20, 2016
See #125 (comment)

Signed-off-by: Michal Čihař <michal@cihar.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants