Recent

Author Topic: Error while linking, linux only  (Read 6176 times)

serge_fastmag

  • New member
  • *
  • Posts: 7
Error while linking, linux only
« on: October 15, 2017, 11:50:29 am »
Hi,

I try to port a windows cgi application to linux.
The only way to make this application compiles is to add the unit "Interfaces" as the first uses unit.
If not, I get "error while linking" error.

The use of the unit "Interfaces" is not OK with apache 2.4, Apache allways produce an error. It's like Interfaces is not compatible with cgi apps.

Linux: ubuntu 17.04
Lazarus: 1.6.4

Any idea for this problem please ?

Thanks

Serge
« Last Edit: October 15, 2017, 11:52:25 am by serge_fastmag »

munair

  • Hero Member
  • *****
  • Posts: 798
  • compiler developer @SharpBASIC
    • SharpBASIC
Re: Error while linking, linux only
« Reply #1 on: October 15, 2017, 02:11:14 pm »
CGI is command line only. Do you have any GUI references? Also check your project settings. Porting from Windows requires adjustments.
keep it simple

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Error while linking, linux only
« Reply #2 on: October 15, 2017, 04:43:18 pm »
Help us help you by giving information as precise as possible, it is too vague to find out what's wrong.

serge_fastmag

  • New member
  • *
  • Posts: 7
Re: Error while linking, linux only
« Reply #3 on: October 15, 2017, 06:38:59 pm »

I know that a cgi is a command line application.
I remove all reference to Dialogs and Forms in my units.
I am using other commercial unit from devart, indy, synapse, ...
 
Even if something is wrong from my part, the compiler should tell me what's wrong, isn't it ?
The error message is too simple "error while linking" !

What king of adjustment are needed when porting from windows to linux please ?

munair

  • Hero Member
  • *****
  • Posts: 798
  • compiler developer @SharpBASIC
    • SharpBASIC
Re: Error while linking, linux only
« Reply #4 on: October 15, 2017, 07:15:54 pm »
In Project Options you may need to set Config and Target to Linux (or default). Also, make sure the correct library is installed (for gtk or Qt).

If compiles fine under Windows, it should also compile on Linux, provided the code is cross platform. Synapse doesn;t give me any problems, but you may need to check this.

It is difficult to provide help if we don't know more details about your project and the (third party) code.

keep it simple

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Error while linking, linux only
« Reply #5 on: October 15, 2017, 08:26:12 pm »
Even if something is wrong from my part, the compiler should tell me what's wrong, isn't it ?
The error message is too simple "error while linking" !
Right click Messages window->Copy->Copy All/Hidden Messages to Clipboard.

serge_fastmag

  • New member
  • *
  • Posts: 7
Re: Error while linking, linux only
« Reply #6 on: October 19, 2017, 08:34:45 am »
Hi,

Unable to compile my project on linux with Lazarus despite your help.

I go back to Delphi, I will try Delphi Tokyo 10.2 which allows to compile webBroker under Linux.

Pity.

Serge

Thaddy

  • Hero Member
  • *****
  • Posts: 14373
  • Sensorship about opinions does not belong here.
Re: Error while linking, linux only
« Reply #7 on: October 19, 2017, 08:49:38 am »
My guess is wrong bitness for some of the used libraries. If you compile for 64 bit make sure your libraries are also 64 bit. If you compile for 32 bit make sure your libraries are 32 bit.
Lazarus/FPC on its own will never throw that error except when out of resources. So it must be a third party issue.
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Error while linking, linux only
« Reply #8 on: October 19, 2017, 09:08:12 am »
Hi,

Unable to compile my project on linux with Lazarus despite your help.

I go back to Delphi, I will try Delphi Tokyo 10.2 which allows to compile webBroker under Linux.

Pity.

Serge
You didn't even tell what the complete message is. By all means, go with Delphi since from what I see you're used to developing on Windows. Lazarus on Linux, just like any other Linux software, requires understanding of the underlying distro. Linking errors due to missing/incompatible libraries will list respective libraries, but you must find out yourself om how to install them because it varies from distro to distro.

bee

  • Sr. Member
  • ****
  • Posts: 393
Re: Error while linking, linux only
« Reply #9 on: October 19, 2017, 09:18:01 am »
The first and most problem of people come from Delphi and Windows to Lazarus and Linux is they think Lazarus would behave like Delphi and Linux would behave like Windows, which both are -of course- wrong. :D

When the "Delphi compatible" mantra doesn't work, it becomes a curse. >:D
« Last Edit: October 19, 2017, 09:25:40 am by bee »
-Bee-

A long time pascal lover.

serge_fastmag

  • New member
  • *
  • Posts: 7
Re: Error while linking, linux only
« Reply #10 on: November 15, 2017, 01:26:42 am »
Hi,

I'am back with the solution :-)

The problem has been solved when removing some standard delphi unit unnecessary from Uses section.
Example: FileCtrl

I don't know why, but now it works.

Serge

 

TinyPortal © 2005-2018