-
Notifications
You must be signed in to change notification settings - Fork 34
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
frontend.c needs some tweaks to be built with MSVC #12
Comments
Hello, I have committed some changes to github, are you getting any other errors in MSVC? nick. |
Hi, Setting stdin/stdout to binary mode is essential for MSVC or MINGW like this: _setmode(0, _O_BINARY); MSVC doesn't have unistd.h, therefore dummy(empty) unistd.h is needed somewhere. MSVC doesn't have getopt, too. I borrowed getopt from BSD implementation. Finally, I have enabled pipe streaming from stdin with libsndfile. As far as I know, libsndfile is capable of reading from non-seekable device, and sf_open_fd() is usable for that purpose. I think, many users want to feed at least WAV files via pipe... |
Apparently, my patch is VERY adhoc. If you want to it to be more autotools friendly, HAVE_UNISTD_H, HAVE_IO_H, HAVE_SETMODE or something would be nicer. (A bit older) win32 port is also found at here: http://www.rarewares.org/mp3-others.php They seem to have dropped libsndfile dependency, and instead have built-in wav parser. |
Ok, thanks. I will try and incorporate some of those changes back into trunk. An easy to use DLL and a static binary of the frontend would be handy for people. I don't have Windows, so it will be hard to test. |
twolame doesn't seem to compile with mingw. |
Sorry, I don't use Windows. If you are able to provide a patch, that would be great. |
Regarding MinGW-w64: I managed to compile twolame with GCC 4.5.2, three years ago. But now several .h files have changed (_mingw.h and types.h, minimum, probably crtdefs.h as well), and trying to build even the original 0.3.13 code with GCC 4.8.1 results in a truckload of errors. Since you yourself said you're not much into Windows, I highly recommend that you firstly drop all the MSVC and Windows-related references, because in this way, probably it will be less difficult to adjust the source-code later and make it compatible with the recent editions of MinGW. The files configure.ac and Makefile.am would have to go through some serious rewrite, I presume. Also, I still don't see the point of forcing the dependency on libsndfile onto the command-line frontend. |
Now I'm trying to compile the OLD twolame 0.3.13 (from the year 2011) with GCC 4.9.2. P.S.: okay, I just had to add another CPPFLAGS option to the command-line. |
The above patch link doesn't work anymore, closing this. If anyone has some improvements for Windows, please raise a Pull Request. |
Hi, thanks for your works.
At line 740 of frontend.c, "int bytes_out" is declared at the middle of the block scope around it, therefore can't be compiled with compilers which doesn't support C99 (at least MSVC).
I also tried forcing C++ compilation, but C++ compilation also requires some fix, because of lines like this:
char *string = malloc(MAX_NAME_SIZE);
(This is legal in C, but not in C++: it requires explicit cast)
The text was updated successfully, but these errors were encountered: