Re: [fltk.bugs] [HIGH] STR #2632: FL_EXPORT that should not exists

2011-05-20 Thread Mathieu Peyréga

DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2632
Version: 1.3-current


Hello,

I just posted a tiny project using only Fl_Multiline_Output, which
reproduce the issue.

It's a VS2010 solution, the path to FLTK library should probably be
changed as the one in the solution match my devel environment.
I also use a modified fltkdll name so in the linker input section, you may
have to change it to match your devel environment.

If you then try to build with genuine Fl_Multiline_Output header file,
you'll (i hope !) get the missing constructor and destructor messages.

Regards,

Mathieu


Link: http://www.fltk.org/str.php?L2632
Version: 1.3-current

___
fltk-bugs mailing list
fltk-bugs@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-bugs


Re: [fltk.bugs] [HIGH] STR #2632: FL_EXPORT that should not exists

2011-05-20 Thread Mathieu Peyréga
DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2632
Version: 1.3-current


Attached file "FL_EXPORT_Issue.7z"...


Link: http://www.fltk.org/str.php?L2632
Version: 1.3-current

FL_EXPORT_Issue.7z
Description: Binary data
___
fltk-bugs mailing list
fltk-bugs@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-bugs


Re: [fltk.bugs] [HIGH] STR #2632: FL_EXPORT that should not exists

2011-05-19 Thread Mathieu Peyréga

DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2632
Version: 1.3-current


Hello,

- here is the error message answer :

To get the following messages (localized in french), i only reverted to
genuine file for Fl_Multiline_Output, let the modification for other files
(but messages are then very similar)

1>PopUpMessageWidgetClass.obj : error LNK2001: symbole externe non résolu
"__declspec(dllimport) public: virtual __thiscall
Fl_Multiline_Output::~Fl_Multiline_Output(void)"
(__imp_??1Fl_Multiline_Output@@UAE@XZ)

1>PopUpMessageWidgetClass.obj : error LNK2001: symbole externe non résolu
"__declspec(dllimport) public: __thiscall
Fl_Multiline_Output::Fl_Multiline_Output(int,int,int,int,char const *)"
(__imp_??0Fl_Multiline_Output@@QAE@PBD@Z)

1>C:\Users\Mathieu\Documents\Devel\Incub\..\bin\Incub\vc100\Win32\Release\LibIncubSoftware.dll
: fatal error LNK1120: 2 externes non résolus

without FL_EXPORT : it builds (and works) perfectly

- here is the answer about the program structure :

the build errors occurs in a custom DLL that is using FLTK code, and were
i am deriving from FLTK classes  and exporting my custom widgets.

- here is the answer about problematic classes :

Fl_Input_Int
Fl_Multiline_Input
Fl_Multiline_Output

These derived class are located inside my custom DLL, and exported from
this DLL (with mecanism similar to the FL_EXPORT one in order to have a
compile time define switching from dllimport to dllexport)

I am having those error messages only for class were i'm deriving other
classes from.

- I'll try today to build a small solution to demonstrate and share the
behaviour.


Link: http://www.fltk.org/str.php?L2632
Version: 1.3-current

___
fltk-bugs mailing list
fltk-bugs@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-bugs


Re: [fltk.bugs] [HIGH] STR #2632: FL_EXPORT that should not exists

2011-05-18 Thread Albrecht Schlosser

DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2632
Version: 1.3-current


Good question - I assume: yes. Sigh.
A build of test/device.cxx with DLL would probably show...


Link: http://www.fltk.org/str.php?L2632
Version: 1.3-current

___
fltk-bugs mailing list
fltk-bugs@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-bugs


Re: [fltk.bugs] [HIGH] STR #2632: FL_EXPORT that should not exists

2011-05-18 Thread Manolo Gouy

DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2632
Version: 1.3-current


Application programs are unlikely to derive classes from Fl_Printer,
but are expected to create objects of this class. Is FL_EXPORT
necessary then ?


Link: http://www.fltk.org/str.php?L2632
Version: 1.3-current

___
fltk-bugs mailing list
fltk-bugs@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-bugs


Re: [fltk.bugs] [HIGH] STR #2632: FL_EXPORT that should not exists

2011-05-18 Thread Albrecht Schlosser

DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2632
Version: 1.3-current


Manolo, I believe that FL_EXPORT (and FL_DLL) is only used with the MS
tools, MinGW doesn't use it this way, but I'm not sure about this. I
assume that building the dll with the appropriate linker options
(something like -Wl,--export-all or similar) does the job for MinGW.

As for the printing classes you mentioned: This would obviously only be a
problem if someone derived his own classes from them. If they are only
used internally, they should IMHO not be exported (by the dll), so this
would all be okay. But as above, I'm not sure about this...


Link: http://www.fltk.org/str.php?L2632
Version: 1.3-current

___
fltk-bugs mailing list
fltk-bugs@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-bugs


Re: [fltk.bugs] [HIGH] STR #2632: FL_EXPORT that should not exists

2011-05-18 Thread Albrecht Schlosser

DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2632
Version: 1.3-current


Mathieu, thanks for your analysis and the MS link. I think most of us FLTK
developers are "confused" by this MS-specific dll_export and dll_import
stuff. Probably no one is using the MS tools for development, and most use
static linking anyway. That said...

As for why class Fl_Output is marked "don't use FL_EXPORT here !": We got
a message about missing FL_EXPORT statement for classes, and I tried to
add them and maybe some more. Then we got a report about error messages (I
don't remember exactly which errors), and someone removed some FL_EXPORT
statements and added the comment shown above. Maybe the reason was to do
with link errors because of missing c'tors and d'tors.

My assumptions, as far as I *may* have understood the problem:

Maybe your assumption is correct that "header only" classes should not
have the FL_EXPORT statement, since they would never be implemented in a
(FLTK) dll. But then we are in the dilemma that derived classes would
suffer from the rule that all base classes must be in the dll as well
(FL_EXPORT), since their c'tors would call the base class's c'tor.

Your second assumption that moving the c'tors of all classes to their own
.cxx files (with FL_EXPORT) would really solve this problem seem
reasonable...

And you are doing it the right way if you only use FL_DLL in your
compilations (FL_INTERNAL may optionally used as well, as you noted).

To understand the problem even better, please answer these questions:

(1) What are the exact error messages you encounter
(1a) with the default build
(1b) with any modifications

(2) How is the structure of your project=
(2a) Main program [1] with only FLTK as dll(s) ?
(2b) Main program [1] + your dll(s) (including FLTK code) + FLTK dll(s) ?
This might make a difference.
[1] No matter if only one module or more than 1 .cxx files.

(3) From which problematic FLTK classes did you derive your own classes
(and if, are they in your main program or in your own dll)? With
"problematic" I mean the header-only classes you mentioned above. Do you
only get error messages for those that you derived your own classes from?
(This would explain why we get error reports about *some* classes only,
and this all doesn't seem to be consistent.)

Last question: Do you have a simple project that you could post here that
exhibits the problem? Maybe as a .zip or .tgz file? I'd like to understand
the problem and have this fixed eventually. I could test with VS 2008/2010
Express...


Link: http://www.fltk.org/str.php?L2632
Version: 1.3-current

___
fltk-bugs mailing list
fltk-bugs@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-bugs


Re: [fltk.bugs] [HIGH] STR #2632: FL_EXPORT that should not exists

2011-05-17 Thread Manolo Gouy

DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2632
Version: 1.3-current


Many of the new classes introduced for printing support don't
have the FL_EXPORT declaration:
- in Fl_PostScript.H, classes Fl_PostScript_Graphics_Driver and
Fl_PostScript_File_Device;
- in Fl_Paged_Device.H, class Fl_Paged_Device;
- in Fl_Printer.H, classes Fl_System_Printer and Fl_Printer.

I use MinGW to compile static libraries under MSWindows, so I don't
see any FL_EXPORT-related errors.
My understanding is that the device demo program that uses the 
Fl_Printer class has been compiled and linked with MSVC tools 
without error. Isn't that correct ? So this FL_EXPORT business
remains obscure to me.

Could any DLL-aware developer check these 3 header files ? Thanks.


Link: http://www.fltk.org/str.php?L2632
Version: 1.3-current

___
fltk-bugs mailing list
fltk-bugs@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-bugs


Re: [fltk.bugs] [HIGH] STR #2632: FL_EXPORT that should not exists

2011-05-17 Thread Mathieu Peyréga

DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2632
Version: 1.3-current


Hello,

thank you for your replies.

i think i'm doing it the right way : i'm only having FL_DLL preprocessor
definition and not FL_LIBRARY... (in some projects i'm also using
FL_INTERNAL but not here)

In this project, all other classes are behaving fine (at link time), only
those that are ".H" only (no cxx file) have this misssing constructor and
destructor issue at link time.
This let me think that there is some inline / __dllexport issues (altough
i don't understand exactly why... looking at the MSDN docs about this, i
did not see anything special)

By the way, why the Fl_Output.H would state
"// don't use FL_EXPORT here !" if it should be used for derived classes ?

I've just turned to FLTK 1.3rc5 and was using 1.1.10 before that. In
1.1.10 version there were no FL_EXPORT for Fl_Multiline_Output,
Fl_Multiline_Input and those classes that are ".H" only

I tried adding the FL_EXPORT to Fl_Output class to match the microsoft
statement that all the class hierarchy should have it if one derived class
have, but it's not solving the issue. Only removing the FL_EXPORT for those
classes that are ".H" only seems to solve the issue (like it was in 1.1.10)
As those classes are ".H" only, it makes no difference for the final user.
(maybe another work around would be to have a cxx file defined for those
class with the constructor in it ?)

Regards,

Mathieu


Link: http://www.fltk.org/str.php?L2632
Version: 1.3-current

___
fltk-bugs mailing list
fltk-bugs@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-bugs


Re: [fltk.bugs] [HIGH] STR #2632: FL_EXPORT that should not exists

2011-05-17 Thread Ian MacArthur

DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2632
Version: 1.3-current


If you refer to the header file Fl_Export.H, you will see that FL_EXPORT is
defined to 3 possible values:

#  if defined(FL_DLL)
#ifdef FL_LIBRARY
#  define FL_EXPORT __declspec(dllexport)
#else
#  define FL_EXPORT __declspec(dllimport)
#endif /* FL_LIBRARY */
#  else
#define FL_EXPORT
#  endif /* FL_DLL */

The intent, then, is that if the BUILD defines FL_DLL and FL_LIBRARY, then
FL_EXPORT will be set for building the DLL.

If you set only FL_DLL then FL_EXPORT will be set for *using* the DLL, but
FL_LIBRARY must *not* be defined in that case.

Or you can set neither FL_DLL or FL_LIBRARY and in that case FL_EXPORT
will have no value, and that is the "normal" mode for all general building
- and may work for using the DLL too, of course.

Is that not what you want?

What values does your build set for FL_DLL and FL_LIBRARY ?

It sounds to me like your build may be setting them inappropriately, as no
one else is reporting issues with this.
Well, not so far, anyway!


Link: http://www.fltk.org/str.php?L2632
Version: 1.3-current

___
fltk-bugs mailing list
fltk-bugs@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-bugs


Re: [fltk.bugs] [HIGH] STR #2632: FL_EXPORT that should not exists

2011-05-17 Thread Mathieu Peyréga

DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2632
Version: 1.3-current


maybe i've not been precise enought, but the issue is not with building the
library : it builds fine, but when using it... (and more precisly when
using the dll version)


Link: http://www.fltk.org/str.php?L2632
Version: 1.3-current

___
fltk-bugs mailing list
fltk-bugs@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-bugs


Re: [fltk.bugs] [HIGH] STR #2632: FL_EXPORT that should not exists

2011-05-17 Thread Mathieu Peyréga

DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2632
Version: 1.3-current


Host platform is Win32 (Vista Pro)
Host Compiler is VS2010

this is original exerpt from Fl_Output.H

*/
class Fl_Output : public Fl_Input { // don't use FL_EXPORT here !
public:
  /**

this is original exerpt from Fl_Multiline_Output.H

*/
class FL_EXPORT Fl_Multiline_Output : public Fl_Output {
public:
  /**

but http://msdn.microsoft.com/en-us/library/81h27t8c.aspx

states in paragraph "Inheritance and Exportable Classes" :

All base classes of an exportable class must be exportable

What i'm seing with original code is that when linking versus the dll
version of FLTK, the linker is issuing errors for missing construtors and
destructors for Fl_Multiline_Output class.
When i remove the FL_EXPORT, it seems allright.
I have not tryied adding the FL_EXPORT to Fl_Output definiton.

Regards,

Mathieu


Link: http://www.fltk.org/str.php?L2632
Version: 1.3-current

___
fltk-bugs mailing list
fltk-bugs@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-bugs


[fltk.bugs] [HIGH] STR #2632: FL_EXPORT that should not exists

2011-05-17 Thread Mathieu Peyréga

DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2632
Version: 1.3-current


in 1.3.0 rc 5

Fl_Multiline_Input
Fl_Multiline_Output
Fl_Input_Int

class definitions have the FL_EXPORT symbol that should not be used 
(and this prevent correct linking when using DLL versions)

(there may be other class but i noticed those right now)


Link: http://www.fltk.org/str.php?L2632
Version: 1.3-current

___
fltk-bugs mailing list
fltk-bugs@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-bugs


Re: [fltk.bugs] [HIGH] STR #2632: FL_EXPORT that should not exists

2011-05-17 Thread Ian MacArthur

DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2632
Version: 1.3-current


You will need to provide more information:

What host platform?
What compiler toolchain?
What build process?

I can't see what the problem is - maybe I am missing something obvious?

As far as I can tell, the FL_EXPORT macro seems to be getting defined (or
made empty) as approporiate to the build target, and all is good.

What are you doing that is triggering this problem?


Link: http://www.fltk.org/str.php?L2632
Version: 1.3-current

___
fltk-bugs mailing list
fltk-bugs@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-bugs