fxruby-users Mailing List for FXRuby (Page 15)
Status: Inactive
Brought to you by:
lyle
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(75) |
Jul
(90) |
Aug
(61) |
Sep
(56) |
Oct
(56) |
Nov
(39) |
Dec
(83) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(56) |
Feb
(45) |
Mar
(61) |
Apr
(40) |
May
(95) |
Jun
(79) |
Jul
(63) |
Aug
|
Sep
(4) |
Oct
|
Nov
|
Dec
|
From: jeroen <je...@fo...> - 2004-02-26 20:46:32
|
On Thursday 26 February 2004 02:16 pm, Paul Rogers wrote: > Thanks for the quick repy - I should have added im using windows. > > Ive also found that in a new thread the dialog doesnt always appear. Could > well be something else in there causing this problem though. Please note that only one thread, the one that created all the windows, is the one that is allowed to play with the widget tree. All other threads must be humble worker-bees... - Jeroen -- +----------------------------------------------------------------------------+ | Copyright (C) 23:50 12/11/2003 Jeroen van der Zijp. All Rights Reserved. | +----------------------------------------------------------------------------+ |
From: Paul R. <pau...@sh...> - 2004-02-26 20:19:07
|
Thanks for the quick repy - I should have added im using windows. Ive also found that in a new thread the dialog doesnt always appear. Could well be something else in there causing this problem though. Thanks Paul ----- Original Message ----- From: jeroen <je...@fo...> Date: Thursday, February 26, 2004 10:59 am Subject: Re: [Fxruby-users] FXFileDialog and threads > On Thursday 26 February 2004 11:38 am, Paul Rogers wrote: > > Im using an FXFileDialog to save a file. > > > > The application also has some other threads running - some doing > no FX > > things, and at least one doing things with FX > > > > If I display the dialog while the threads are running I get random > > segmentation faults. But if I switch them off, the segmentation > faults dont > > happen. > > > > I can get round this particular problem by running the dialog in > a new > > thread. > > > > If I get the chance I'll write a simpler app that demonstrates > the problem. > > If you're on UNIX, try --enable-threadsafe when you're configuring. > > > > > - Jeroen > > -- > +------------------------------------------------------------------ > ----------+ > | Copyright (C) 23:50 12/11/2003 Jeroen van der Zijp. All Rights > Reserved. | > +------------------------------------------------------------------ > ----------+ > > > > ------------------------------------------------------- > SF.Net is sponsored by: Speed Start Your Linux Apps Now. > Build and deploy apps & Web services for Linux with > a free DVD software kit from IBM. Click Now! > http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click > _______________________________________________ > Fxruby-users mailing list > Fxr...@li... > https://lists.sourceforge.net/lists/listinfo/fxruby-users > |
From: jeroen <je...@fo...> - 2004-02-26 18:02:29
|
On Thursday 26 February 2004 11:38 am, Paul Rogers wrote: > Im using an FXFileDialog to save a file. > > The application also has some other threads running - some doing no FX > things, and at least one doing things with FX > > If I display the dialog while the threads are running I get random > segmentation faults. But if I switch them off, the segmentation faults dont > happen. > > I can get round this particular problem by running the dialog in a new > thread. > > If I get the chance I'll write a simpler app that demonstrates the problem. If you're on UNIX, try --enable-threadsafe when you're configuring. - Jeroen -- +----------------------------------------------------------------------------+ | Copyright (C) 23:50 12/11/2003 Jeroen van der Zijp. All Rights Reserved. | +----------------------------------------------------------------------------+ |
From: Paul R. <pau...@sh...> - 2004-02-26 17:44:00
|
Im using an FXFileDialog to save a file. The application also has some other threads running - some doing no FX things, and at least one doing things with FX If I display the dialog while the threads are running I get random segmentation faults. But if I switch them off, the segmentation faults dont happen. I can get round this particular problem by running the dialog in a new thread. If I get the chance I'll write a simpler app that demonstrates the problem. Thanks Paul |
From: Paul R. <pau...@sh...> - 2004-02-26 17:40:53
|
First let me thank Lyle for writing FXRuby. Its a really useful toolkit. Now onto the problem: Im using a sel_command and a sel_changed on a text field Sometimes I find that the sel_command gets fired when I click on a different widget. I was only expecting it to get fired on pressing return. As Im connecting to both events do I need to do anything special? Do I need to some how trap that the enter key was pressed? Thanks Paul |
From: Jamey C. <jc...@tw...> - 2004-02-26 14:58:46
|
Sorry if this question has been answered. I googled but did not find anything... I'm trying to sort an IconList by the column that is clicked when the user clicks a column header. If I use the sortItems method, it just sorts by the first column. I tried using sort_by: @iconlist.sort_by {|item| item.getText.split("\t")[@clickedColumn]} But that didn't do anything. Is there a way to sort the IconList by anything other than the first column? Thanks. Jamey Cribbs Confidentiality Notice: This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and/or privileged information. If you are not the intended recipient(s), you are hereby notified that any dissemination, unauthorized review, use, disclosure or distribution of this email and any materials contained in any attachments is prohibited. If you receive this message in error, or are not the intended recipient(s), please immediately notify the sender by email and destroy all copies of the original message, including attachments. |
From: Lyle J. <ly...@kn...> - 2004-02-26 02:52:47
|
On Feb 25, 2004, at 5:29 PM, Matthew Miller wrote: > When selecting items in the FXList I see two different behaviors after > starting > the program: When I select one item and press and hold Ctrl, and then > select > other items and release Ctrl a message box shows that the correct > number of > items are selected. > > Conversely, before I select an item I press and hold Ctrl, and then > start > selecting items. When Ctrl is released the message box shows that zero > items > have been selected. My question is why I'm seeing this differing > behavior based > on when the first item is selected. It is a subtle problem, and has to do with the keyboard focus: when you press or release the Ctrl key, which window is going to receive those SEL_KEYPRESS and SEL_KEYRELEASE messages? In your first experiment, you start by selecting one item from the list. To do that you of course had to click somewhere in the list widget's content area, and that action assigned the keyboard focus to the list. For that reason, the list widget is the widget that "hears" the subsequent SEL_KEYPRESS and SEL_KEYRELEASE messages. In your second experiment, you pressed the Ctrl key before ever doing anything to transfer the focus to the list widget. The result is that the list widget never got that SEL_KEYPRESS message, and so it never set your @ctrlPressed attribute to true. The rest of the problems you described of course follow from that. The simplest solution is to make sure that the list gets the keyboard focus right away, by calling the list's setFocus() method somewhere in the main window's initialize() method, e.g. @list = FXList.new( frame, 0, nil, 0, LAYOUT_FILL_Y|LAYOUT_FILL_X|LIST_NORMAL ) @list.setFocus() After making this change, I think you will find that the selection count in the second experiment works as expected. Hope this helps, Lyle |
From: Matthew M. <nam...@na...> - 2004-02-25 23:31:08
|
Hello, I'm working on learning FXRuby and to do that I'm writing a basic file manager. My program uses FXList to display the file and directory names and I have a question about some behavior I'm seeing. Since what I have done so far is so few lines my program is included between the body and signature. When selecting items in the FXList I see two different behaviors after starting the program: When I select one item and press and hold Ctrl, and then select other items and release Ctrl a message box shows that the correct number of items are selected. Conversely, before I select an item I press and hold Ctrl, and then start selecting items. When Ctrl is released the message box shows that zero items have been selected. My question is why I'm seeing this differing behavior based on when the first item is selected. Thanks for any help, Matthew. #!/usr/local/bin/ruby -w require 'fox' include Fox class FileListWindow < FXMainWindow def initialize(app) # Invoke the base class initialize first super(app, "Ruby File Manager", nil, nil, DECOR_ALL, 0, 0, 300, 600) @status = FXStatusbar.new(self, LAYOUT_SIDE_BOTTOM|LAYOUT_FILL_X); frame = FXVerticalFrame.new(self, LAYOUT_FILL_X|LAYOUT_FILL_Y ) @list = FXList.new( frame, 0, nil, 0, LAYOUT_FILL_Y|LAYOUT_FILL_X|LIST_NORMAL ) font = FXFont.new( app, "courier", 9, FONTWEIGHT_MEDIUM ) @list.font = font @list.connect( SEL_DOUBLECLICKED, method(:onDoubleClick)) @list.connect( SEL_KEYPRESS, method(:onKeyPress)) @list.connect( SEL_KEYRELEASE, method(:onKeyRelease)) @list.connect( SEL_SELECTED, method(:onSelect)) @list.connect( SEL_DESELECTED, method(:onDeselect)) # Variables for hold state information. @selectedItems = Array.new @selectedIndex = nil @ctrlPressed = false readDir('.') end def onDeselect( sender, sel, which ) if @ctrlPressed @selectedItems.delete( which ) end end def onSelect( sender, sel, event ) @selectedIndex = event if @ctrlPressed @selectedItems << @selectedIndex else @selectedItems.clear end end # Check to see if the keypress event is one we are interested in. def onKeyPress( sender, sel, event ) case event.code when KEY_Control_L, KEY_Control_R @ctrlPressed = true if ! @selectedIndex.nil? and @selectedItems[@selectedItems.size-1] != @selectedIndex @selectedItems << @selectedIndex end end end # Same here, check the release event to see if it one we watch for. def onKeyRelease( sender, sel, event ) case event.code when KEY_Control_L, KEY_Control_R @ctrlPressed = false FXMessageBox.question(self, MBOX_OK, 'Selected Items', "The number of selected items is #{@selectedItems.size}" ) end end def readDir( path ) @list.clearItems( false ) dir = Dir.open( path ) begin dir.each { |item| filename = item.dup stat = File.lstat( item ) if stat.directory? item << '/' elsif stat.executable? item << '*' end @list.appendItem( item, nil, filename ) } ensure dir.close end end # Take to proper action for the item that was double clicked. def onDoubleClick( sender, sel, which ) name = @list.getItemData( which ) stat = File.lstat( name ) if stat.directory? Dir.chdir( name ) readDir( '.' ) else # a file of some type, do something else. # end end # Start def create # Create window super # Show the main window show(PLACEMENT_SCREEN) end end # Make an application application = FXApp.new("Ruby File Manager", "Matthew Miller") # Open display application.init(ARGV) # Create main window window = FileListWindow.new(application) # Create the application application.create # Run application.run -- "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." - Brian W. Kernighan |
From: Hal F. <ha...@hy...> - 2004-02-22 00:00:04
|
Lyle Johnson wrote: > The last few weeks have been very busy, as I've been trying to wrap > things up at my old job. Starting at the new job a week from Monday, so > I should have a little more time this week to catch on e-mails. If > you've posted a question to the list in the last week or so, I probably > still have it here and will try to respond to those in the next few > days. If you're not sure, send me e-mail privately to remind me ;) Ha, poor Lyle, busy as a cat on Ex-Lax. Actually one reason I joined this list was so that my dependence on you might be reduced as others took up the slack. I'm always appreciative of your tech support, but I'm acutely aware that you have other things to do than tutor me in fxruby. Anyway: That project I was working on is now (sort of) on Rubyforge. See http://tycho.rubyforge.org which has a lot of notes and a few crude drawings. Cheers, Hal |
From: Lyle J. <ly...@kn...> - 2004-02-21 21:38:59
|
The last few weeks have been very busy, as I've been trying to wrap things up at my old job. Starting at the new job a week from Monday, so I should have a little more time this week to catch on e-mails. If you've posted a question to the list in the last week or so, I probably still have it here and will try to respond to those in the next few days. If you're not sure, send me e-mail privately to remind me ;) Thanks as always for your patience! |
From: Hal F. <ha...@hy...> - 2004-02-21 02:12:34
|
Jeroen, jeroen wrote: (snip) Thanks much for the info. >>Is there some way to put little independent windows into a bigger >>window without using this mdi stuff? > > You're not required to use FXMDIClient and FXMDIChild at all. OK, that's great. May I get some hints as to how to accomplish this? I want the smaller windows to stay within the larger one, placed more or less randomly, and overlapping. (I'm not worried about the "random" part -- I can come up with some algorithm for that.) For some very crude artwork of this: http://rubyhacker.com/projects/tycho Thanks, Hal Fulton |
From: <tku...@so...> - 2004-02-20 20:42:53
|
I found the right answer to my problem, thanks to Lyle's documentation at http://www.fxruby.org/doc/api/. I was catching the wrong event. What I had to do was catch the SEL_COMMAND and not SEL_KEYPRESS events. What a newbie I am. Anyway, it works wonderful now. The textfield acts just as you would expect when given TEXTFIELD_REAL, and SEL_COMMAND of course grabs "enter", which is exactly what I wanted. Tom |
From: jeroen <je...@fo...> - 2004-02-20 14:38:59
|
On Thursday 19 February 2004 10:22 pm, Hal Fulton wrote: > Hello, all. > > This is my first post to this ml. Remains to be seen whether it will > work. > > I'm confused about something. I want to change the (minimized) size > of an MDIChild window so that the children will "tile" inside the > parent like bricks. > > I see no way to do it. I can resize the child while it's in "normal" > mode, but that seems to have nothing to do with the minimized size. > > I'd also be interested in simply *detecting* the size of the minimized > window. > > Any ideas? You can subclass FXMDIChild, and overload its getDefaultWidth() to return the size of your "brick". > Actually the MDIChild seems fairly "unmanipulable" anyway. AFAIK there > is no way to get rid of the little icon on the left of the title bar > or the three "sizer" icons on the right. Yes, that's true. Your overloaded FXMDIChild could probably hide them. > Is there some way to put little independent windows into a bigger > window without using this mdi stuff? You're not required to use FXMDIClient and FXMDIChild at all. - Jeroen -- +----------------------------------------------------------------------------+ | Copyright (C) 23:50 12/11/2003 Jeroen van der Zijp. All Rights Reserved. | +----------------------------------------------------------------------------+ |
From: Hal F. <ha...@hy...> - 2004-02-20 04:28:32
|
Hello, all. This is my first post to this ml. Remains to be seen whether it will work. I'm confused about something. I want to change the (minimized) size of an MDIChild window so that the children will "tile" inside the parent like bricks. I see no way to do it. I can resize the child while it's in "normal" mode, but that seems to have nothing to do with the minimized size. I'd also be interested in simply *detecting* the size of the minimized window. Any ideas? Actually the MDIChild seems fairly "unmanipulable" anyway. AFAIK there is no way to get rid of the little icon on the left of the title bar or the three "sizer" icons on the right. Is there some way to put little independent windows into a bigger window without using this mdi stuff? Thanks, Hal Fulton |
From: <tku...@so...> - 2004-02-20 00:34:30
|
Hi, I have a window derived from FXDialogBox, and I would like to have it respond to either mouse clicks in the "OK" box as well as hitting the enter key. I tried an initial attempt at it by doing something like this: (tf is a FXTextfield) ... @tf.connect(SEL_KEYPRESS) do |send,sel,ptr| onNewKeypress(send,sel,ptr) end ... def onNewKeypress(send,sel,ptr) asciival = ptr.text[0].to_i if asciival == 13 # Enter key onCmdAccept(send,sel,ptr) else @tf.text += ptr.text @tf.setCursorPos(@tf.text.length) end end (This isn't necessarily 100% runnable code, I just copied it out of my head, but the idea should be there) The problem is, that now that I have used connect() on the textfield, I lose the TEXTFIELD_REAL option, because I'm handling all keypresses myself in the above function. I started adding stuff into the above function to catch various keys, but then I realized I was probably re-implementing all of what's already in the default keypress handler. The goal is to have "enter" treated differently than other keystrokes, so that hitting enter while in the field causes automatic onCmdAccept for the dialog box. After probably wasting time writing a dozen or two lines of code, I think there's probably already an answer that isn't nearly so hard. Any suggestions would be greatly appreciated. Thanks, Tom |
From: Joel V. <vj...@us...> - 2004-02-19 20:54:00
|
Joel VanderWerf wrote: > > Hi, I've got Fox working on QNX6.2.1, and I've got ruby working, but > FXRuby doesn't build for me. Anybody else try this? > > The problems atm have to so with constness in C++: > > /usr/include/string.h: In function `void * memchr(void *, int, unsigned > int)': > /usr/include/string.h:125: declaration of C function `void * memchr(void > *, int, unsigned int)' conflicts with > /usr/include/string.h:49: previous declaration `const void * > memchr(const void *, int, unsigned int)' here > > ...and more like that > > When you include string.h with __cplusplus defined, these declarations > become inconsistent. I tried a minimal .cpp example (based on hello.cpp > from Fox) that includes "string.h", but couldn't recreate the problem. > So probably something is misconfigured in FXRuby, but what precisely... Well, I still don't understand it, but I do have a kludgy workaround. I just put the following file in ext/fox/include: ==== ruby.h ==== #include "string.h" #include "/usr/local/lib/ruby/1.8/i386-nto-qnx6.2.1/ruby.h" ================ This forces string.h to be read without the extern "C" context, which is what seems to be causing the problem. It's not really particularly an FXRuby problem. It could be solved (I think) by swig-ruby if the #include "ruby.h" were preceded by #include "string.h" in the wrap files. Or better yet, it could be solved in ruby.h, since this is likely to come up with any C++ extension on QNX, by including "string.h" near the top of the file (conditional on QNX, I suppose). Anyway, the FXRuby build succeeds with this change. Now I have to try to build FXRuby statically when I build ruby, because disabling shared objects seems to be necessary on QNX for ruby extensions that are linked statically with other libraries. (Or at least that's what happens with readline.) |
From: Richard <ri...@li...> - 2004-02-19 19:14:22
|
Category: Application/GUI Project name: ezexerb Short description: FXRuby GUI for the Exerb tool Version: 1.0.0 Status: stable Last update: 2004-02-19 19:00:23 GMT Owner: Richard Lyman (Projects of this owner) Homepage: not available Download: http://www.lithinos.com/ezexerb/EZExerb.zip License: Proprietary Description: After Exerb (3.2.0) is installed this tool makes the creation of EXR and EXE files easier. You have the option of hiding the DOS window and, you can keep or remove the EXR and MAK files generated during the compile process. This version also supports referencing a Ruby install directory other than the default. Tested on: 98, 2000, and XP 1.0.0 - Release date: 18.02.04 0.9.0 - Release date: 15.02.04 |
From: John R. <col...@ya...> - 2004-02-19 04:46:46
|
This suggestion was posted by Lyle (Google) some time ago:When you click the kill button on the main window, it (theFXMainWindowobject) first sends a SEL_CLOSE message to its message target, if any.If that target handles the message then life goes on (i.e. the application doesn't shut down). If the main window doesn't have a message target, or if it does but the target doesn't handle the SEL_CLOSE message, then the main window sends a SEL_COMMAND message (with identifier FXApp::ID_QUIT) to the application (FXApp) object.Andthat more or less terminates the main FOX event loop.So for what you're describing, I think I'd try something like this: theMainWindow.connect(SEL_CLOSE) do # Do fun things verify_things clean_up_things if ok_to_quit? # All is well to shut down, so go ahead # and send the ID_QUIT message to the # application. theMainWindow.app.handle(theMainWindow, MKUINT(FXApp::ID_QUIT, SEL_COMMAND), nil) else # We've decided not to shut down after all end endHope this helps,LyleI see what you did in the above example, and I'm trying to do the samething in my code without much luck.Here's how my class is defined:class DataTable < FXMainWindowAnd then my widgets are attached to this object: contents = FXVerticalFrame.new(self, LAYOUT_SIDE_TOP|FRAME_NONE|LAYOUT_FILL_X|LAYOUT_FILL_Y)Then the code is like this: frame = FXVerticalFrame.new(contents, FRAME_SUNKEN|FRAME_THICK|LAYOUT_FILL_X|LAYOUT_FILL_Y) do |f| f.padLeft = 0 f.padRight = 0 f.padTop = 0 f.padBottom = 0 end # Table @@table = FXTable.new(frame, 20, 7, nil, 0, TABLE_COL_SIZABLE|TABLE_ROW_SIZABLE|LAYOUT_FILL_X|LAYOUT_FILL_Y, 0,0,0,0, 2,2,2,2)I don't know how to capture the SEL_CLOSE event in my program becauseif the dialog box used in the program for data entry is open, andthere have been changes, I want to warn the user about those changes.I tried attaching the .connect(SEL_CLOSE) to the contents object, butthat didn't work.Thanks for the help,John Reed --------------------------------- Do you Yahoo!? Yahoo! Mail SpamGuard - Read only the mail you want. |
From: Jamey C. <cr...@oa...> - 2004-02-18 16:51:01
|
Kevin Burge wrote: > Anybody know how to override the tip text for an FXIconList? Tried > handling ID_QUERY_TIP (happens only when the mouse first enters the > list), and FXIconList::ID_TIPTIMER and FXIconList::ID_LOOKUPTIMER to > no avail. Tried descending from onTipTimer, and that doesn't work > either. > > I'm getting the impression that if a control already handle's a > message, then it can never be handled by a descendant control......???? > I override the onQueryTip method to suppress the tooltip. I don't know if this might give a clue as to how to do what you want. I have to thank Lyle for this tip. Here's an example of the code I use: class IconList < FXIconList def initialize(*args) super(*args) FXMAPFUNC(SEL_UPDATE, FXIconList::ID_QUERY_TIP, :onQueryTip) end # Suppress the tooltip... def onQueryTip(sender, sel, ptr) return 0 end end Jamey Confidentiality Notice: This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and/or privileged information. If you are not the intended recipient(s), you are hereby notified that any dissemination, unauthorized review, use, disclosure or distribution of this email and any materials contained in any attachments is prohibited. If you receive this message in error, or are not the intended recipient(s), please immediately notify the sender by email and destroy all copies of the original message, including attachments. |
From: Kevin B. <kev...@sy...> - 2004-02-18 16:03:43
|
Anybody know how to override the tip text for an FXIconList? Tried handling ID_QUERY_TIP (happens only when the mouse first enters the list), and FXIconList::ID_TIPTIMER and FXIconList::ID_LOOKUPTIMER to no avail. Tried descending from onTipTimer, and that doesn't work either. I'm getting the impression that if a control already handle's a message, then it can never be handled by a descendant control......???? -- Kevin Burge Systemware, Inc. kev...@sy... www.systemware.com |
From: Kevin B. <kev...@sy...> - 2004-02-13 22:38:11
|
Anyone know of a way to stop the focus from going to the FXList in a combobox? What this results in is focus being on a hidden window, so it looks like you have to tab twice to get past a combobox. -- Kevin Burge Systemware, Inc. kev...@sy... www.systemware.com |
From: Kevin B. <kev...@sy...> - 2004-02-13 22:09:03
|
Anybody know how programmatically set the focus to a combo box? mycb.setFocus does not work because FXComboBox is really an FXPacker. I just want the cursor to go the the FXTextField of the combobox. -- Kevin Burge Systemware, Inc. kev...@sy... www.systemware.com |
From: Joel V. <vj...@us...> - 2004-02-13 06:50:05
|
Lyle Johnson wrote: > > On Feb 12, 2004, at 7:06 PM, Joel VanderWerf wrote: > >> Hi, I've got Fox working on QNX6.2.1, and I've got ruby working, but >> FXRuby doesn't build for me. Anybody else try this? >> >> The problems atm have to so with constness in C++: >> >> /usr/include/string.h: In function `void * memchr(void *, int, >> unsigned int)': >> /usr/include/string.h:125: declaration of C function `void * >> memchr(void *, int, unsigned int)' conflicts with >> /usr/include/string.h:49: previous declaration `const void * >> memchr(const void *, int, unsigned int)' here >> >> ...and more like that >> >> When you include string.h with __cplusplus defined, these declarations >> become inconsistent. I tried a minimal .cpp example (based on >> hello.cpp from Fox) that includes "string.h", but couldn't recreate >> the problem. So probably something is misconfigured in FXRuby, but >> what precisely... > > > That's a new one. Which file(s) from FXRuby is it trying to compile when > you get this error message? It's in core_wrap.cpp (full error log attached). > When you compile code with a C++ compiler, the compiler's supposed to > (internally) define the __cplusplus symbol. And what I would expect to > see in a header file like string.h, if there is a "C version" of > memchr() and a "C++ version" of memchr(), would be something like this: > > #ifdef __cplusplus > // Here's the C++ declaration... > const void * memchr(const void *, int, unsigned int); > #else > /* Here's the C declaration, without const */ > void * memchr(void *, int, unsigned int); > #endif > > That is, I'd expect the compiler to see one or the other, but not both! Here's some more of string.h: 40 #ifdef __cplusplus 41 #define _Const_return const 42 #else 43 #define _Const_return 44 #endif 45 46 __BEGIN_DECLS 47 48 _C_STD_BEGIN 49 extern _Const_return void *memchr( const void *__s, int __c, size_t __n ); 122 #ifdef __cplusplus 123 _C_STD_BEGIN 124 inline void *memchr(void *_S, int _C, _CSTD size_t _N) 125 { /* call with const first argument */ So, from the error messages, it's pretty clear that __cplusplus is defined at both locations. Looks pretty inconsistent to me, but somehow building Fox and its examples didn't produce the message. One of our local QNX programmers had this comment: > I've encountered problems something like what you are talking about > with the memchr definition conflict when a package has an ifdef __QNX__ > somewhere that really sets things up for QNX4 and you have to > change it to if defined(__QNX__) && !defined(__QNXNTO__) (I may not > have the predefined compiler variables named exactly correctly) because > the substitution is incorrect for QNX6. But I don't see any testing of QNX or qnx in the FXRuby source (in fact those strings don't occur anywhere). We'll take a look at it together tomorrow, and I'll let you know if we get anywhere. |
From: Lyle J. <ly...@kn...> - 2004-02-13 04:16:11
|
On Feb 12, 2004, at 7:06 PM, Joel VanderWerf wrote: > Hi, I've got Fox working on QNX6.2.1, and I've got ruby working, but > FXRuby doesn't build for me. Anybody else try this? > > The problems atm have to so with constness in C++: > > /usr/include/string.h: In function `void * memchr(void *, int, > unsigned int)': > /usr/include/string.h:125: declaration of C function `void * > memchr(void *, int, unsigned int)' conflicts with > /usr/include/string.h:49: previous declaration `const void * > memchr(const void *, int, unsigned int)' here > > ...and more like that > > When you include string.h with __cplusplus defined, these declarations > become inconsistent. I tried a minimal .cpp example (based on > hello.cpp from Fox) that includes "string.h", but couldn't recreate > the problem. So probably something is misconfigured in FXRuby, but > what precisely... That's a new one. Which file(s) from FXRuby is it trying to compile when you get this error message? When you compile code with a C++ compiler, the compiler's supposed to (internally) define the __cplusplus symbol. And what I would expect to see in a header file like string.h, if there is a "C version" of memchr() and a "C++ version" of memchr(), would be something like this: #ifdef __cplusplus // Here's the C++ declaration... const void * memchr(const void *, int, unsigned int); #else /* Here's the C declaration, without const */ void * memchr(void *, int, unsigned int); #endif That is, I'd expect the compiler to see one or the other, but not both! |
From: Joel V. <vj...@us...> - 2004-02-13 01:18:14
|
Hi, I've got Fox working on QNX6.2.1, and I've got ruby working, but FXRuby doesn't build for me. Anybody else try this? The problems atm have to so with constness in C++: /usr/include/string.h: In function `void * memchr(void *, int, unsigned int)': /usr/include/string.h:125: declaration of C function `void * memchr(void *, int, unsigned int)' conflicts with /usr/include/string.h:49: previous declaration `const void * memchr(const void *, int, unsigned int)' here ...and more like that When you include string.h with __cplusplus defined, these declarations become inconsistent. I tried a minimal .cpp example (based on hello.cpp from Fox) that includes "string.h", but couldn't recreate the problem. So probably something is misconfigured in FXRuby, but what precisely... |