Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2007-08

converting flexcel to fpc

9 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Bisma Jayadi

Hi all,

I'm now trying to compile FlexCel v.2.5.3 (latest open source version before it's bought by TMS) using FPC v.2.0.4 on Linux (Kubuntu 6.10 Feitsy). After adding IFDEFs here and there, finally FPC is able to compile it. But, I don't know why FPC fails to linking program (to executable) that uses FlexCel units. The linking process shows nothing but a simple "linking error" message.

Even a very simple program that uses a FlexCel unit without any codes on the main block also fails to link. If somebody interested to help or assist me on this, I'll be very appreciated. Soon Flexcel can be used by FPC, I believe we can natively read/write MS Excel (BIFF-8) files on any platforms. Like it or not, MS Office suite still leads the office market.

I thank you in advance for any kind of helps/replies.

Regards,

-Bee-

has Bee.ography at:
http://beeography.wordpress.com

Bisma Jayadi
to Bisma Jayadi
Show quoted text 6 lines
I'm now trying to compile FlexCel v.2.5.3 (latest open source version before it's bought by TMS) using FPC v.2.0.4 on Linux (Kubuntu 6.10 Feitsy). After adding IFDEFs here and there, finally FPC is able to compile it. But, I don't know why FPC fails to linking program (to executable) that uses FlexCel units. The linking process shows nothing but a simple "linking error" message.

I can send the complete source code of the package to someone who interested on this, through private mail. Thanks.

-Bee-

has Bee.ography at:
http://beeography.wordpress.com

Michael Van Canneyt
to Bisma Jayadi: I'm now trying to compile FlexCel v.2.5.3 (latest open source version before it's bought…
Bisma Jayadi wrote 13 lines
Hi all, I'm now trying to compile FlexCel v.2.5.3 (latest open source version before it's bought by TMS) using FPC v.2.0.4 on Linux (Kubuntu 6.10 Feitsy). After adding IFDEFs here and there, finally FPC is able to compile it. But, I don't know why FPC fails to linking program (to executable) that uses FlexCel units. The linking process shows nothing but a simple "linking error" message. Even a very simple program that uses a FlexCel unit without any codes on the main block also fails to link. If somebody interested to help or assist me on this, I'll be very appreciated. Soon Flexcel can be used by FPC, I believe we can natively read/write MS Excel (BIFF-8) files on any platforms. Like it or not, MS Office suite still leads the office market.

If you are referring to the treetron component,
http://treetron.googlepages.com/

then you misunderstand it's design.

It's not going to work, since at the core of it is a binary library which uses the TMS component. Presumably FPC does not find the library, hence the linking error.

Michael.

Bisma Jayadi
to Michael Van Canneyt
If you are referring to the treetron component, http://treetron.googlepages.com/

No, it's not.

then you misunderstand it's design.

I know.

It's not going to work, since at the core of it is a binary library which uses the TMS component. Presumably FPC does not find the library, hence the linking error.

FlexCel that I'm trying to convert is the real FlexCel package while it was still an open source project. You still can find it on Delphi Super Page -> Kylix 3 -> Print, Print Preview and Reporting Tools. It's the only component within that category.

-Bee-

has Bee.ography at:
http://beeography.wordpress.com

Michael Van Canneyt
to Bisma Jayadi
Bisma Jayadi wrote 18 lines
> If you are referring to the treetron component, > http://treetron.googlepages.com/ No, it's not. > then you misunderstand it's design. I know. > It's not going to work, since at the core of it is a binary library which > uses > the TMS component. Presumably FPC does not find the library, hence the > linking error. FlexCel that I'm trying to convert is the real FlexCel package while it was still an open source project. You still can find it on Delphi Super Page -> Kylix 3 -> Print, Print Preview and Reporting Tools. It's the only component within that category.

Ok, I found it. Checked the sources:

In that case, did you adapt the libgsf-1.so library name, or specify the directory where it can be found ? if you use Kubuntu, chances are that it is not installed, as it is part of GNOME.

Michael.

Bisma Jayadi
Thanks for the code. What example were you trying to compile? Didn't you create a package file for the component? Just give me a startingpoint

No, I didn't do that far (create a package). Just to make sure first the component will be compiled by FPC 2.0.4. Sorry, I forgot to give you the example. :-D

please, it saves me from searching too long.

For first test, simply...

program TestFlexCel;
{$APPTYPE CONSOLE}

uses
UFlexCelImport,

   XLSAdapter;
var
   FlexCelImport1: TFlexCelImport;
   XLSAdapter1: TXLSAdapter;
   i,j: Integer;
   s,v: string;
begin
   XLSAdapter1 := TXLSAdapter.Create(nil);
   FlexCelImport1 := TFlexCelImport.Create(nil);
   FlexCelImport1.Adapter := XLSAdapter1;
   FlexCelImport1.OpenFile('your_excel_file_here');
   for i := 1 to 5 do
   begin
     s := '';
     for j := 1 to 5 do
     begin
       v := FlexCelImport1.CellValue[i,j];
       s := s + v + ';';
     end;
     Writeln(s);
   end;
   FlexCelImport1.Free;
   XLSAdapter1.Free;
end.

The above example should print out 5 first columns and 5 first rows of the excel file. Tested using Delphi on winXP.

HTH.

-Bee-

has Bee.ography at:
http://beeography.wordpress.com

Bisma Jayadi
to Michael Van Canneyt: Ok, I found it. Checked the sources: In that case, did you adapt the libgsf-1.so library…
In that case, did you adapt the libgsf-1.so library name, or specify the directory where it can be found ?

I'd had installed the required libs as mentioned in the source files and also the related libs as well. I believe I had specified the path too. But, maybe I have to make sure this again. Thanks.

-Bee-

has Bee.ography at:
http://beeography.wordpress.com

Florian Klaempfl
to Bisma Jayadi
Show quoted text 6 lines
> In that case, did you adapt the libgsf-1.so library name, or specify > the directory where it can be found ? I'd had installed the required libs as mentioned in the source files and also the related libs as well. I believe I had specified the path too. But, maybe I have to make sure this again. Thanks.

Compile with -s and link manually by calling ppas.bat to get the complete linker output.

Bisma Jayadi
to Bisma Jayadi: I'm now trying to compile FlexCel v.2.5.3 (latest open source version before it's bought…
Show quoted text 6 lines
I'm now trying to compile FlexCel v.2.5.3 (latest open source version before it's bought by TMS) using FPC v.2.0.4 on Linux (Kubuntu 6.10 Feitsy). After adding IFDEFs here and there, finally FPC is able to compile it. But, I don't know why FPC fails to linking program (to executable) that uses FlexCel units. The linking process shows nothing but a simple "linking error" message.

I've found the problem, and now it's compiled and linked properly. It's just a matter of missing required libraries.

I did this effort without an official permission from the original author. Because I thought that v.2.5.3 still remains as an open source project and only the later becomes commercial. However my thought was wrong. Today my permission request to convert FlexCel v.2.5.3 to FPC got reply from the author (Adrian Gallero). The main point is he doesn't allow me or other developers to do anything with v.2.5.3 source code. Just leave it there as it is, he said in his email to me. He seems to be disappointed by the previous license (freeware with source) to know that along this year he only got 4 clients who pay for FlexCel. :(

But, I also got a good news about FlexCel. Next release of FlexCel (still on TMS) will natively support FPC and should be able to be run on any platforms supported by FPC because it only uses native pascal code. Still, FlexCel ain't gonna be an open source project. FlexCel license is just like other TMS' VCL: free for non-commercial purpose without source code. :(

So, I ask to everybody who already got the modified source code from me, please do not distribute it further. You may keep it as personal collection but you're not allowed to redistribute it to other people. I'm sorry.

For any kind of help regarding this effort, I thank you very much. :)

-Bee-

has Bee.ography at:
http://beeography.wordpress.com