IUP and FB 0.24

External libraries (GTK, GSL, SDL, Allegro, OpenGL, etc) questions.
TriumphRacer
Posts: 164
Joined: Aug 28, 2005 21:06
Location: irwin, pa
Contact:

IUP and FB 0.24

Post by TriumphRacer »

About a year and a half ago I wrote a console program to solve a particular issue. It worked well so I decided to also do a Windows version. I had been using LibertyBASIC but opted to try something new so I used IUP. Using freeBASIC 0.21 and IUP 3.30, and after getting some wonderful help here in these forums, the program worked beautifully. I really liked IUP as I could make the program visually similar to the console program. This made my help file really easy to construct.

Several weeks ago, a need arose to add a database to the program. I went back to the original console program, added the necessary SQLite info and, again with much needed help from these forums, the program turned out wonderfully.

However, this new program was done in freeBASIC 0.24. When I tried to combine the new SQLite code with the IUP interface, using IUP 3.30 and freeBASIC 0.24, got some error msgs.

Code: Select all

FreeBASIC Compiler - Version 0.24.0 (08-19-2012) for win32
Copyright (C) 2004-2012 The FreeBASIC development team.
standalone, objinfo (libbfd 217)
compiling:    ptbgxxxx.bas -o ptbgxxxx.asm (main module)
c:\progra~1\freeba~1.240\inc\IUP3\iupkey.bi(78) error 4: Duplicated definition, K_a in '#define K_a asc("a")'
c:\progra~1\freeba~1.240\inc\IUP3\iupkey.bi(79) error 4: Duplicated definition, K_b in '#define K_b asc("b")'
c:\progra~1\freeba~1.240\inc\IUP3\iupkey.bi(80) error 4: Duplicated definition, K_c in '#define K_c asc("c")'
c:\progra~1\freeba~1.240\inc\IUP3\iupkey.bi(81) error 4: Duplicated definition, K_d in '#define K_d asc("d")'
c:\progra~1\freeba~1.240\inc\IUP3\iupkey.bi(82) error 4: Duplicated definition, K_e in '#define K_e asc("e")'
c:\progra~1\freeba~1.240\inc\IUP3\iupkey.bi(83) error 4: Duplicated definition, K_f in '#define K_f asc("f")'
c:\progra~1\freeba~1.240\inc\IUP3\iupkey.bi(84) error 4: Duplicated definition, K_g in '#define K_g asc("g")'
c:\progra~1\freeba~1.240\inc\IUP3\iupkey.bi(85) error 4: Duplicated definition, K_h in '#define K_h asc("h")'
c:\progra~1\freeba~1.240\inc\IUP3\iupkey.bi(86) error 4: Duplicated definition, K_i in '#define K_i asc("i")'
c:\progra~1\freeba~1.240\inc\IUP3\iupkey.bi(87) error 4: Duplicated definition, K_j in '#define K_j asc("j")'
c:\progra~1\freeba~1.240\inc\IUP3\iupkey.bi(87) error 122: Too many errors, exiting
I remember when I had done the original IUP program, reading about this on these forums. Checking the dates on all the IUP .bi files, I see they have all been updated for FB 0.24. Is there a new workaround for this?

Oh, I'm using the standard FB 0.24 Windows installer installation, nothing added.

Thanks in advance.

Bill
ike
Posts: 387
Joined: Jan 17, 2011 18:59

Re: IUP and FB 0.24

Post by ike »

Last edited by ike on Mar 25, 2014 21:30, edited 3 times in total.
TriumphRacer
Posts: 164
Joined: Aug 28, 2005 21:06
Location: irwin, pa
Contact:

Re: IUP and FB 0.24

Post by TriumphRacer »

Silly me! I assumed that the headers and libs that came with FB 0.24 would be OK. Thank you. I downloaded the files mentioned in your post. I had followed the AGS topic when I originally did the console conversion to IUP about a year ago. I had done a "search" for IUP on this forum when I got the aforementioned error msgs. and most of what came up was what I had read originally.

Thanks again. I'll try these new .bi files and hopefully have no further problems.

Bill
TriumphRacer
Posts: 164
Joined: Aug 28, 2005 21:06
Location: irwin, pa
Contact:

Re: IUP and FB 0.24

Post by TriumphRacer »

Sorry, didn't work. I downloaded and installed IUP3.5-nolua-freebasic-headers-only.zip. Funny thing. The files in inc\IUP3 that came with the FB 0.24 install were dated 7/31/2012. The new headers that came with the .zip file had dates of 9/8/2011 and 9/9/2011.

I'm still getting the same error msgs (see my original post).

Any other suggestions?

Bill
gothon
Posts: 225
Joined: Apr 11, 2011 22:22

Re: IUP and FB 0.24

Post by gothon »

TriumphRacer wrote:
Sorry, didn't work. I downloaded and installed IUP3.5-nolua-freebasic-headers-only.zip. Funny thing. The files in inc\IUP3 that came with the FB 0.24 install were dated 7/31/2012. The new headers that came with the .zip file had dates of 9/8/2011 and 9/9/2011.

I'm still getting the same error msgs (see my original post).

Any other suggestions?

Bill
I think the headers by D.J.Peters (same thread second post) are probably better; you should try them not the one you downloaded.
D.J.Peters wrote:This are a complete rewrote (fixed many wrong declares) and is a more complete IUP package for FreeBASIC.

IUP 3.5
Windows: fbIUP3.5Windows.7z
Linux: fbIUPLinux.tar.gz

IUP 3.7 (preview)
Windows: fbIUP3.7Windows.7z
Although, I haven't done any IUP programming myself yet, so I can't be sure; I think these are the best FB IUP headers made so far.
TriumphRacer
Posts: 164
Joined: Aug 28, 2005 21:06
Location: irwin, pa
Contact:

Re: IUP and FB 0.24

Post by TriumphRacer »

gothon wrote: I think the headers by D.J.Peters (same thread second post) are probably better; you should try them not the one you downloaded.
D.J.Peters wrote:This are a complete rewrote (fixed many wrong declares) and is a more complete IUP package for FreeBASIC.
IUP 3.5
Windows: fbIUP3.5Windows.7z
Linux: fbIUPLinux.tar.gz
IUP 3.7 (preview)
Windows: fbIUP3.7Windows.7z
Although, I haven't done any IUP programming myself yet, so I can't be sure; I think these are the best FB IUP headers made so far.
I had downloaded the Peters file also. It not only includes new headers (with dates of 12/10/2012 and 11/29/2012) but also an entire new set of files for the /lib subdirectory. Can I get by by just installing the headers from that 7zip file or do I need to install everything? The Peters file includes a lot of things not in the original distribution such as new /bin, /media, /doc subdirectories. Also the /lib has not only /win but also /win32dll.

In the interim, I simply fell back on FB 0.21 and everything is compiling fine.

Bill
ike
Posts: 387
Joined: Jan 17, 2011 18:59

Re: IUP and FB 0.24

Post by ike »

Read first page
http://www.freebasic.net/forum/viewtopi ... 14&t=18500

and find this:

...
in FB, K_A is the same as K_a. To fix this, you can just go through and add and extra underscore to the capitals, K_A -> K_A_, K_B -> K_B_, etc..
...

That may be solution for you?
TriumphRacer
Posts: 164
Joined: Aug 28, 2005 21:06
Location: irwin, pa
Contact:

Re: IUP and FB 0.24

Post by TriumphRacer »

ike wrote:Read first page
http://www.freebasic.net/forum/viewtopi ... 14&t=18500
and find this:
...
in FB, K_A is the same as K_a. To fix this, you can just go through and add and extra underscore to the capitals, K_A -> K_A_, K_B -> K_B_, etc..
...
That may be solution for you?
Yes, I had read that in the orginal thread. There was also one or two other possible fixes. I think it would be safer to continue using FB 0.21 and wait for the "powers that be" to decide on how they wish to fix the issue and then use that release of freeBASIC. It's just me personally but I'd prefer an "official" fix that would be included with an "official" distribution release as opposed to one generated by an individual user.

Bill
Bunuel66
Posts: 76
Joined: May 19, 2006 19:56

Re: IUP and FB 0.24

Post by Bunuel66 »

I use currently FB 0.24 with IUP. My 'tricks' are the following

-Use the headers from IUP3 and change the programs accordingly
-Correctet the headers as described, this is mainly a problem of dupplication.
-Change iupOpen() by iupOpen(NULL,NULL)

should be mainly all what is needed.

Some functions have their interface changed in IUP3 and it is necessary to correct on a cas by case. Currently all the examples are working.

That said, for simple GUI interfaces I use Zenity on LInux. It is really easier.

Regards
TriumphRacer
Posts: 164
Joined: Aug 28, 2005 21:06
Location: irwin, pa
Contact:

Re: IUP and FB 0.24

Post by TriumphRacer »

OK, totally new problem. About 2 wks ago, hard drive crashed irretrievably. Had to install a new one. Lost about 2 mths of code on 2 programs, this is one of them. Had to re-install EVERYTHING!

Decided to try FB 0.24 again. Downloaded it and installed to:
C:\FreeBASIC_win.024

Unzipped fbIUP3.5Windows.7z to:
C:\temp

Zipped up all files in:
C:\FreeBASIC_win.024\inc\IUP3

Copied files from:
C:\temp\IUP\fbIUP3.5Windows\inc to C:\FreeBASIC_win.024\inc\IUP3

Copied all files from:
C:\temp\IUP\fbIUP3.5Windows\lib\win32 and C:\temp\IUP\fbIUP3.5Windows\lib\win32dll to
C:\FreeBASIC_win.024\lib

No name conflicts so all the files copied over OK. Tried to compile programs and got following errors:

C:\Documents and Settings\All Users\Documents\src\perftune\GUI\freeBASIC>c:\Free
BASIC_win.024\fbc-win -v -w all -map ptbgxxxx.map ptbgxxxx.bas > ptbgxxxx.err
ptbgxxxx.o:fake:(.text+0x15e3): undefined reference to `IupCbox'
ptbgxxxx.o:fake:(.text+0x29f3): undefined reference to `IupCbox'
ptbgxxxx.o:fake:(.text+0x457d): undefined reference to `IupCbox'
ptbgxxxx.o:fake:(.text+0x541e): undefined reference to `IupCbox'

Checked the IUP3\iup.bi in the new install and IupCbox is defined. Any idea what's going on?

I had originally compiled the program in FB 0.21 and IUP 3.0 but I lost that info when the drive crashed and I forget what files I had used to make IUP (including IupCbox) work with that install.

Thanks in advance.

Bill
MichaelW
Posts: 3500
Joined: May 16, 2006 22:34
Location: USA

Re: IUP and FB 0.24

Post by MichaelW »

Checked the IUP3\iup.bi in the new install and IupCbox is defined.
More correctly, it’s declared there. It’s supposed to be defined in the IUP DLL/import library, and the import library libiup.dll.a in my 0.24.0 installation does not contain any reference to IupCbox.
TriumphRacer
Posts: 164
Joined: Aug 28, 2005 21:06
Location: irwin, pa
Contact:

Re: IUP and FB 0.24

Post by TriumphRacer »

More correctly, it’s declared there. It’s supposed to be defined in the IUP DLL/import library, and the import library libiup.dll.a in my 0.24.0 installation does not contain any reference to IupCbox.
OK, so how do I fix it?????

Bill
TriumphRacer
Posts: 164
Joined: Aug 28, 2005 21:06
Location: irwin, pa
Contact:

Re: IUP and FB 0.24

Post by TriumphRacer »

More correctly, it’s declared there. It’s supposed to be defined in the IUP DLL/import library, and the import library libiup.dll.a in my 0.24.0 installation does not contain any reference to IupCbox.
Hmm, upon further consideration, my question is "What program did you use to look 'inside' the libiup.dll.a?". I remember using a library manager back in the QB days, what is the comparable program for freeBASIC?

Bill
MichaelW
Posts: 3500
Joined: May 16, 2006 22:34
Location: USA

Re: IUP and FB 0.24

Post by MichaelW »

"What program did you use to look 'inside' the libiup.dll.a?".
Nothing specialized I just opened it in an editor and searched for the name. You will probably want to enable the editor's wrap option, and you must avoid modifying the file. Within my experience this technique works for import libraries, static libraries, or DLLs.

Some related information:
http://blogs.msdn.com/b/oldnewthing/arc ... 80250.aspx
TriumphRacer
Posts: 164
Joined: Aug 28, 2005 21:06
Location: irwin, pa
Contact:

Re: IUP and FB 0.24

Post by TriumphRacer »

Nothing specialized I just opened it in an editor and searched for the name. You will probably want to enable the editor's wrap option, and you must avoid modifying the file. Within my experience this technique works for import libraries, static libraries, or DLLs.
I tried that. I use Context for my text editor (http://www.contexteditor.org/) and I couldn't find the name.

Anyway, I did a search on libiup.* on my C drive and got the following:

libiup.dll.a C:\FreeBASIC_win.15b\lib\win32 151 kb 11/30/2005 1:00 PM
libiup.dll.a C:\FreeBASIC_win.0200b\lib\win32 151 kb 1/13/2006 12:39 AM
libiup.dll.a C:\FreeBASIC_win.0211\lib\win32 156 kb 8/11/2010 12:45 PM
libiup.a C:\FreeBASIC_win.024\lib\win32 772 kb 4/26/2011 10:28 AM
libiup.a C:\temp\IUP\fbIUP3.5Windows\lib\win32 772 kb 4/26/2011 10:28 AM
libiup.a C:\FreeBASIC_win.024\lib\win32dll 242 kb 4/26/2011 2:28 PM
libiup.a C:\temp\IUP\fbIUP3.5Windows\lib\win32dll242 kb 4/26/2011 2:28 PM
libiup.a lib/win32dll 242 kb 4/26/2011 10:28 PM
libiup.dll.a lib 143 kb 10/10/2011 2:35 PM
libiup.dll.a FreeBASIC-024.0-win/lib/win32 142 kb 8/17/2012 8:10 PM
libiup.dll.a C:\FreeBASIC_win.024\lib\win32 142 kb 8/17/2012 8:10 PM
libiup.a lib/win32 833 kb 11/30/2012 6:21 AM

Of special note are the files listed in my FB 024 install. Now bearing in mind that I'm using a "vanilla" FB 024 install with the fbIUP3.5Windows.7z file with no other changes, when I compile, will the process use the libiup.a found in C:\FreeBASIC_win.024\lib\win32 or the libiup.dll.a found in C:\FreeBASIC_win.024\lib\win32 or the libiup.a in C:\FreeBASIC_win.024\lib\win32dll? If I rename the one it's using, and using the other, maybe my problem will be solved.

The sad part about it is that I had all this working with FB 021, the original iup30_rc2_static.zip and one other file. Problem is, I can't remember what that other file was or where I got it. It got lost when my hard drive crashed. I do remember that the instructions that came with the file said to replace the .BI files and to replace certain .A files. And I think that libiup.a included with that file was dated 7/18/2009 was one of those files.

While I was typing this up, I loaded up both the libiup.a and libiup.dll.a from C:\FreeBASIC_win.024\lib\win32 and the libiup.a from C:\FreeBASIC_win.024\lib\win32dll in Context and searched for iupcbox. Found it in libiup.a (7 occurences), none in libiup.dll.a and libiup.a (10 occurences) in the \win32dll subdirectory. So my prior question may solve my problem. How can force the compilation process to use the libiup.a file instead of the libiup.dll.a???

This wouldn't bother me so much if I didn't already have the program well under way using IUPCbox.

Thanks for the help.

Bill
Post Reply