| [ Return to Bugs & Features | Roadmap 1.3 | SVN ⇄ GIT ]
STR #3137
Application: | FLTK Library |
Duplicate Of: | STR #3232 |
Status: | 2 - Closed w/o Resolution |
Priority: | 3 - Moderate, e.g. unable to compile the software |
Scope: | 2 - Specific to an operating system |
Subsystem: | Core Library |
Summary: | Compiler error in makefile |
Version: | 1.3-current |
Created By: | stmccull |
Assigned To: | AlbrechtS |
Fix Version: | None |
Update Notification: | |
Trouble Report Files:
No files
Trouble Report Comments:
|
#1 | stmccull 10:41 Sep 26, 2014 |
| I'm trying to install fltk on cygwin. I've done: ./configre -enable-cygwin (works ok) make
(works ok for a while, then I get:)
Compiling fl_dnd.cxx... In file included from fl_dnd.cxx:20:0: fl_dnd_win32.cxx: In static member function ‘static int Fl::dnd()’: fl_dnd_win32.cxx:528:27: error: cannot allocate an object of abstract type ‘FLDropSource’ FLDropSource *fds = new FLDropSource; ^ fl_dnd_win32.cxx:313:7: note: because the following virtual functions are pure within ‘FLDropSource’: class FLDropSource : public IDropSource ^ In file included from /usr/include/w32api/urlmon.h:288:0, from /usr/include/w32api/objbase.h:163, from /usr/include/w32api/ole2.h:17, from /usr/include/w32api/wtypes.h:12, from /usr/include/w32api/winscard.h:10, from /usr/include/w32api/windows.h:97, from ../FL/win32.H:28, from ../FL/x.H:41, from fl_dnd_win32.cxx:24, from fl_dnd.cxx:20: /usr/include/w32api/oleidl.h:4059:39: note: virtual HRESULT IDropSource::GiveFeedback(DWORD) virtual HRESULT STDMETHODCALLTYPE GiveFeedback( ^ ../makeinclude:149: recipe for target 'fl_dnd.o' failed make[1]: *** [fl_dnd.o] Error 1 Makefile:24: recipe for target 'all' failed make: *** [all] Error 1
Presumably I'm missing a configuration or something, but I can't find what it is. Any ideas? | |
|
#2 | AlbrechtS 18:56 Sep 26, 2014 |
| A few questions:
(1) Do you really want to use Cygwin? If you configure with --enable-cygwin you will get a dependency on cygwin1.dll, and this may not be what you want (license, distributability, etc.).
(2) Which version of Cygwin do you have, and is it up-to-date? Run 'uname -a' and post the result.
(3) You may have an older or newer version of w32api. Please tell us which version ou have. You may see it in Cygwin's setup program or see below...
(4) Which gcc/g++ version?
(5) Which version of FLTK did you install? If it is 1.3.2 or older, please use a current snapshot or subversion (svn). You will find both on the download page.
I have:
$ uname -a CYGWIN_NT-6.1-WOW64 host 1.7.20(0.266/5/3) 2013-06-07 11:11 i686 Cygwin
$ grep W32API_VERSION /usr/include/w32api/w32api.h #define __W32API_VERSION 3.14
$ g++ --version g++ (GCC) 4.5.3
$ svnversion 10343
I'm using FLTK's current svn, and this works for me: $ ./configure --enable-cygwin $ make
That said, the FLTK team recommends using MinGW for Windows compilation, because it's easier to manage and gives you native Windows apps w/o dependencies on 3rd party dll's (like cygwin1.dll), although you can also use Cygwin and a MinGW cross-compiler.
OTOH, if you really want to use Cygwin, then you can also enable X11 with ./configure --enable-cygwin --enable-X11 but then you will need a running X server (Cygwin's X server works).
Please answer the questions above, so we can check what is going on.
Besides that, if you are not sure what tools to use, please as in fltk.general, since this is where user questions will be answered. https://groups.google.com/forum/#!forum/fltkgeneral | |
|
#3 | AlbrechtS 15:40 Sep 28, 2014 |
| I can confirm the compiler error on my notebook (Win 8.1) with a more recent Cygwin version. Just for reference:
$ uname -a CYGWIN_NT-6.3 host 1.7.32(0.274/5/3) 2014-08-13 23:06 x86_64 Cygwin
$ grep W32API_VERSION /usr/include/w32api/w32api.h #define __W32API_VERSION 3.14
$ g++ --version g++ (GCC) 4.8.3
$ svnversion 10344 | |
|
#4 | stmccull 08:43 Sep 29, 2014 |
| A few questions:
> (1) Do you really want to use Cygwin?
Well, not necessarily, but it's the command-line environment I have (unless you want me to use the dos prompt :) I don't want to buy/install visual studio or whatever.
>(2) Which version of Cygwin do you have, and is it up-to-date? > Run 'uname -a' and post the result.
CYGWIN_NT-6.1 WEDGE 1.7.29(0.272/5/3) 2014-04-07 13:46 x86_64 Cygwin
> (3) You may have an older or newer version of w32api. Please tell us > which version ou have. You may see it in Cygwin's setup program or > see below...
#define __W32API_VERSION 3.14
> (4) Which gcc/g++ version?
g++ (GCC) 4.8.2
> (5) Which version of FLTK did you install? If it is 1.3.2 or older, > please use a current snapshot or subversion (svn). You will find > both on the download page.
I downloaded the 1.3.2 source from the downloads page. Is the svn version newer?
> That said, the FLTK team recommends using MinGW for Windows > compilation, because it's easier to manage and gives you native > Windows apps w/o dependencies on 3rd party dll's (like cygwin1.dll), > although you can also use Cygwin and a MinGW cross-compiler.
I tried that, or something like it, first. But the configure script gave errors that the gcc compiler didn't have a "-mno-cygwin" option:
configure:3164: gcc -mno-cygwin -mno-cygwin -mno-cygwin conftest.c >&5 gcc: error: unrecognized command line option '-mno-cygwin' gcc: error: unrecognized command line option '-mno-cygwin' gcc: error: unrecognized command line option '-mno-cygwin'
I figured that since I was compiling from within cygwin, I needed the -enable-cygwin option. Maybe that's wrong.
I'd probably _rather_ get that working, if possible. Since that way I can just use the MinGW stuff and not be tied to cygwin. If that's possible.
Thanks! | |
|
#5 | AlbrechtS 04:51 Oct 01, 2014 |
| Well, looking at the different setups and the error message, the problem seems to have to do with different compiler versions and w32api. The newer one (gcc 4.8.x) seems to find the pure "virtual functions ... within ‘FLDropSource’" that the older compiler may have ignored. This might be a bug in the w32api files. Or something like that - sorry, no time to investigate now.
You have several options:
(1) ./configure --enable-cygwin --enable-x11
This might work, but may not be what you want (needs cygwin1.dll and an X server). Definitely not recommended. You can't easily distribute your programs. Use only if you really need the POSIX features of Cygwin.dll. The --enable-x11 part is only used to circumvent the bug - maybe.
(2) Cross-compile under Cygwin for Win32/64. This works for me with gcc 4.5.3 and the appropriate MinGW gcc/toolchain (64-bit) installed under Cygwin:
LDFLAGS="-static-libgcc -static-libstdc++" \ ./configure \ --host=x86_64-w64-mingw32 \ --build=i686-pc-cygwin \ --prefix=/usr/local/fltk-w64
Note that this is for Windows 64-bit, but the 32-bit cross-compiler and tools work similar. I don't know though if this works with gcc 4.8.x.
Anyway, I wouldn't recommend this either, because this setup is more complicated than necessary.
Note the LDFLAGS definition: this is to ensure that the MinGW compiler and linker output doesn't depend on two dll's. This is the same when you compile directly with MinGW.
(3) Install MinGW and use this. You can have MinGW and Cygwin installed on the same system w/o trouble, if you don't add global (Windows) PATH environment variables for Cygwin and MinGW. This should be the default, but ...
Here is my configure command for MinGW:
LDFLAGS="-static-libgcc -static-libstdc++" \ ./configure \ --enable-localpng --enable-localjpeg --enable-localzlib \ --prefix=/usr/local/fltk-mingw
As before you should use the LDFLAGS definition to remove dependencies, and you will get native Windows apps that can easily be distributed. The "--enable.." and "--prefix.." parts are optional.
This is the recommended way to build FLTK Windows programs, and this is what most of the FLTK devs are using on Windows, so this is also supported by the team very well. Cygwin, BTW, is not well supported - it tends to break more often.
MinGW can be installed pretty straight-forward today. Use the graphical installer from mingw.org's download links (mingw-get-setup.exe) and follow the instructions. After installing, use mingw-get (similar to apt-get) to update or install additional packages. There is one you may want to generate the man pages:
$ mingw-get --install msys-man
And you may want to install MinTTY or console2 as a better terminal environment to use bash in MinGW.
Please note also that this is not the correct place to answer user questions. Please ask further questions about installing and compiling in fltk.general, as noted above already.
You may also want to read the file README.MSWindows.txt in the source distribution (although some parts are might not be up-to-date). | |
|
#6 | AlbrechtS 04:53 Oct 01, 2014 |
| Note to myself and other devs: The compiler error messages under Cygwin are worth a bug report, and this is still a relevant STR. Needs investigation... | |
|
#7 | AlbrechtS 19:17 Jan 20, 2016 |
| Please see STR #3232 for more information. http://www.fltk.org/str.php?L3232
Note: the compiler error has been fixed, but as of today the linker error still exists.
Closing this STR now, because STR #3232 is about the same issue. | |
[ Return to Bugs & Features ]
|
| |