Recent

Author Topic: Run text mode app in Ubuntu Server  (Read 7285 times)

ricardo.consolo

  • New Member
  • *
  • Posts: 17
Run text mode app in Ubuntu Server
« on: April 08, 2013, 12:38:45 am »
Have build an app that runs only in text mode with Lazarus (1.0.8). When trying to run on a production server (Ubuntu Server 10.04), it displays "Cannot find program X". The app is called ccf and I run it like './ccf'. It runs fine at my developer virtual box (kubuntu 10.04). The server runs fine a "Hello World" app.

My app access a MySQL database. Have installed mysql-client and fpc on server but same message persists.

Any advice?

Thanks.

Dibo

  • Hero Member
  • *****
  • Posts: 1048
Re: Run text mode app in Ubuntu Server
« Reply #1 on: April 08, 2013, 01:01:10 am »
"Cannot find program X" - this is exactly what you get? Or X is replaced by your application name?If not then it seems that console application is trying to act like visual application (trying to run X server which ubuntu server doesn't has by default). Make sure that your console application don't have any visual dependencies like LCL, FCL in Project -> Project inspector -> Required packages

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Run text mode app in Ubuntu Server
« Reply #2 on: April 08, 2013, 01:15:51 am »
what happens to the datamodules then?
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

Dibo

  • Hero Member
  • *****
  • Posts: 1048
Re: Run text mode app in Ubuntu Server
« Reply #3 on: April 08, 2013, 01:37:56 am »
I did simple console test on linux mint (debian distro) with TDataModule, it doesn't need LCL. My "Required package" section is empty. If project has LCL in "Required package" then all visual libs are fired like GTK, QT etc even if console application is working like console application. But I'm not sure, LCL mean "Lazarus Components Library" so it not mean "visual" but it is equivalent of delphi VCL which mean "Visual Componets Library"
« Last Edit: April 08, 2013, 01:43:55 am by Dibo »

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Run text mode app in Ubuntu Server
« Reply #4 on: April 08, 2013, 07:05:06 am »
LCL has dependencies on widgets by default. If you want to eliminate those, select the NoGUI "widgetset" for LCL in the project options.
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

ricardo.consolo

  • New Member
  • *
  • Posts: 17
Re: Run text mode app in Ubuntu Server
« Reply #5 on: April 10, 2013, 10:14:49 pm »
Wow! Thanks for the responses.

The message is not about the X screen. Sorry on that. The message is:

-bash: ./r36migccf: File or Directory not found

I started to rebuild the project looking for the unit who was causing that. Found it: mysql51conn. Just by declaring it, this msg happens.

Right now I'm creating a new vbox with Ubuntu Server (10.04) to install the latest fpc as I found that sqldb is dependent on that. Will write the results on next post.

ricardo.consolo

  • New Member
  • *
  • Posts: 17
Re: Run text mode app in Ubuntu Server
« Reply #6 on: April 11, 2013, 03:31:26 pm »
Nope. I installed these packages and the message remains:

sudo apt-get install build-essential binutils;
sudo dpkg -i fpc*;

fpc is 2.6.2.

If I comment the uses clause on that code, the app runs fine:

Code: [Select]
uses
  mysql51conn;

What file or directory could this unit is looking for?

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Run text mode app in Ubuntu Server
« Reply #7 on: April 11, 2013, 03:39:15 pm »
The mysql-dev .so files that are used to connect to the db along with any files they require, I'd say.
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

ricardo.consolo

  • New Member
  • *
  • Posts: 17
Re: Run text mode app in Ubuntu Server
« Reply #8 on: April 11, 2013, 10:28:35 pm »
No lucky finding it.

The mysql51conn uses an inc file located at /usr/share/fpcsrc/2.6.2/packages/fcl-db/src/sqldb/mysql. Have installed the fpc source package and added this path to the system. The message persists.

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Run text mode app in Ubuntu Server
« Reply #9 on: April 12, 2013, 05:36:29 am »
Added what path to what system? Why?

What about simply going to your Laz and fpc directories and running a recursive grep on that filename?
(Yes, very primitive, but may work)
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

ricardo.consolo

  • New Member
  • *
  • Posts: 17
Re: Run text mode app in Ubuntu Server
« Reply #10 on: April 12, 2013, 04:17:25 pm »
(very) Basic mistake. The target machine is a 64bit SO. I was compiling for 32.

I just wish for a more helpfull error message from fpc compiled app.

Thanks.

 

TinyPortal © 2005-2018