|
Post by Pjot on May 15, 2014 20:16:22 GMT 1
Hi bitvast, The library creation in 3.0 got broken, it is fixed in 3.0.1. BR Peter
|
|
|
Post by bitvast on May 15, 2014 20:25:33 GMT 1
Well, I'm relieved it wasn't me being a numpty. Thanks Peter.
|
|
|
Post by bitvast on May 15, 2014 20:49:02 GMT 1
Peter,
With 3.01 same problem but a different error:
|
|
|
Post by Pjot on May 16, 2014 8:35:03 GMT 1
Well, or me it works:
HTH Peter
|
|
|
Post by bitvast on May 16, 2014 8:53:03 GMT 1
Peter, sorry I should have been more clear. I can create the shared object ok but it's when I try to execute a program using hug_imports that I get the error.
This program compiles fine -
INCLUDE "hug_imports.bac" INIT Mainwin = WINDOW("Hello", 200, 100) My_label = MARK("Hello World!", 100, 30) ATTACH(Mainwin, My_label, 50, 20 ) My_chk = STOCK("gtk-quit", 80, 35) ATTACH(Mainwin, My_chk, 60, 55) CALLBACK(My_chk, QUIT) DISPLAY
But when I execute it I get the undefined symbol error I posted above. By the way I'm using bacongui.
|
|
|
Post by bigbass on May 16, 2014 15:10:26 GMT 1
Hey bitvast
most likely hug imports needs to be updated to the new hug version since there have been many updates recently
===================================================
The main goal of using a shared lib is to maintain a small compiled binary This can be done many ways of course the easiest way is to use hug with the *.so
*An alternative but a much more complex way just to have a demo would be to embed gtk This is not what you asked for but meets the same goal of focusing on just small binaries though gtk could be tamed enough to become readable with the help of an alias
It might be interesting just to see and document how this could be done so here is a demo the size is 12.0 kB after compiling which is very small considering this is stand alone code without an include file or a lib.so
Joe
button-demo.bac
PRAGMA LDFLAGS `pkg-config --libs gtk+-2.0` '--- embed gtk alias keywords ---bigbass PROTO gtk_init ALIAS INIT PROTO gtk_main_quit ALIAS QUIT PROTO gtk_window_new ALIAS WINDOW PROTO gtk_window_set_default_size ALIAS WINDOW_SIZE PROTO gtk_window_set_title ALIAS TITLE PROTO gtk_table_new ALIAS TABLE PROTO gtk_container_add ALIAS CONTAINER PROTO gtk_button_new_from_stock ALIAS STOCK PROTO gtk_table_attach_defaults ALIAS ATTACH PROTO g_signal_connect_data ALIAS CALLBACK PROTO gtk_widget_show_all ALIAS SHOW PROTO gtk_main ALIAS DISPLAY PROTO gtk_label_new ALIAS LABEL
'=================== SUB exit_prog '=================== QUIT END SUB INIT(0, 0) window = WINDOW() WINDOW_SIZE(window, 200, 100) TITLE(window, "Hello world") table = TABLE(15, 15, 1) CONTAINER(window, table) label = LABEL("Bacon with embedded GTK !") ATTACH(table, label, 1, 8, 3, 7) button = STOCK("gtk-quit") ATTACH(table, button, 10, 14, 12, 14) CALLBACK(window, "delete-event", exit_prog, 0, 0, 0) CALLBACK(button, "clicked", exit_prog, 0, 0, 0) SHOW(window) DISPLAY
|
|
|
Post by vovchik on May 16, 2014 15:26:14 GMT 1
Dear Joe, That is good advice for bitvast. PROTO can indeed be used very elegantly with ALIASES to give you code that is very much like HUG. The downside is that you have to dig into the gtk docs, but that is a good learning experience in any case. With kind regards, vovchik
|
|
|
Post by bitvast on May 16, 2014 17:38:31 GMT 1
Hi Joe, Thanks for the suggestion and code. Actually, the main reason I used a SO previously was because it saved some time waiting for the conversion of hug.bac, but version 3.0 is so fast it hardly seems necessary.
|
|
|
Post by Pjot on May 16, 2014 23:16:28 GMT 1
Thanks for noticing bitvast! Actually this is a problem in BaCon, where the shared library creation was incomplete. Created shared objects didn't allow the dynamic loading and resolving of symbols. It is fixed in the latest version of 3.0.1 beta. Can you please verify if this works for you? Thanks, Peter
|
|
|
Post by bitvast on May 17, 2014 10:11:44 GMT 1
Peter, It's working flawlessly now. Thanks!
|
|
|
Post by packetteer on May 17, 2014 17:58:11 GMT 1
Hi All I down loaded and installed Bacon3.0. Very nice job Peter. I am using Puppy Linux Slacko 5-7 My system is setup so that when I click on any .bac file the BaconGui program opens. This worked fine with version 2.4
Now with Bacon version 3.0 what happens is BaconGui version 3.0 opens but the file does not display. The GUI is empty.
I can go to the file menu and open the file that way and everything works just fine.
I would guess it is probably something wrong with my system. Unfortunately I have no idea what it could be.
Any help would be greatly appreciated. Best Regards John
|
|
|
Post by alexfish on May 17, 2014 19:36:57 GMT 1
Hi John
Not sure if on the right track
but are U on about the Restore Tabs in the Bacongui menu Options/Restore tabs
BR Alex
|
|
|
Post by Pjot on May 18, 2014 11:51:58 GMT 1
Hi packetteer, Well, you're right. Parsing arguments to the command line for BaConGUI was changed, so we can enter '-gtk3' now to run BaConGUI in GTK3 mode. Therefore, any filenames were not taken into account anymore. But this is fixed in the latest beta. Please install this version and let me know if it works for you. Thanks for your report, Peter
|
|
|
Post by packetteer on May 18, 2014 13:17:46 GMT 1
Hi Peter Thank you for the fast response. I have down loaded the 3.0.1 beta version. Do I have to uninstall Release version 3.0 before I install the 3.0.1 version?
Since you have such a nice install procedure now I am guessing that 3.0.1 will overwrite 3.0 when installed.
Next week while on vacation I plan on taking one of my Visual Basic Amateur Radio programs and have it run on Linux via Bacon. So next week I will be giving 3.0.1 a good test run with a real world program.
Of course I will let you know how I make out.
Thank you Peter for making it possible for me a Basic programmer to be able to write programs for Linux not just Windows.
Best Regards John
|
|
|
Post by Pjot on May 19, 2014 9:51:49 GMT 1
Yes, that's correct - just install in the same way as you installed 3.0, the existing file will be overwritten.
HTH Peter
|
|