Recent

Author Topic: (Solved) Failed to use Lazres tool on Mac Os x to make a resource.res file  (Read 1674 times)

lestroso

  • Full Member
  • ***
  • Posts: 134
    • FaSasoftware
Dear friends, i have  a problem to use Lazres tool on mac osx ...could someone help me  please?

i write this:
Code: Pascal  [Select][+][-]
  1. lazres resource.res sound1.wav sound2.wav <---- on windows go fine...on mac no. I also tried to compile Lazrestool...
  2.  

again give me an error the terminal...says...ERROR: file not found: sound1.wav  but i have putted the sounds files in the same folder....

if i click directly to the app..or exe it give me this error...


Last login: Tue Aug 20 21:11:06 on ttys000
pippo:~ pippo$ /Users/pippo/Desktop/res/lazres ; exit;
Usage: lazres resourcefilename filename1[=resname1] [filename2[=resname2] ... filenameN=resname[N]]
       lazres resourcefilename @filelist
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[Processo completato]

Can somebody help me please???

Thanks! Lestroso :-[








« Last Edit: August 22, 2019, 04:16:03 pm by lestroso »

wp

  • Hero Member
  • *****
  • Posts: 11833
I don't have a Mac, and I don't have any idea of Mac OSX, so I cannot give you precise help. But did you try putting a ./ in front of the file names? It is important in Linux when executing programs. You also can debug lazres like any other Laz/FPC application; maybe the error message is misleading and the error happens somewhere else.

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2020
  • Former Delphi 1-7, 10.2 user
It won't work if you click on the lazres program because you need to supply the resource filename and the sound file list.

From a terminal, it might not work because lazres might not be on your path. What I did was

Code: [Select]
$ sudo cp /Users/trev/laz-sources/tools/lazres /usr/local/bin/
$ rehash

I'm using the tcsh shell in my terminals which is not the default and the reason for the rehash is so that my shell will pickup the lazres file I copied to /usr/local/bin.

If you're using the default bash shell, then the command is hash -r so that your shell will pickup your addition to /usr/local/bin.

After that I simply:

Code: [Select]
$ lazres resources.res pluck-pcm8.wav pluck-pcm16.wav
pluck-pcm8.wav ResourceName='pluck-pcm8' Type=RT_RCDATA
pluck-pcm16.wav ResourceName='pluck-pcm16' Type=RT_RCDATA

which produced a resources.res file containing the two wav files.

[Edit: removed duplicate content]
« Last Edit: August 21, 2019, 03:28:52 am by trev »

lucamar

  • Hero Member
  • *****
  • Posts: 4219
From a terminal, it might not work because lazres might not be on your path. What I did was

Code: [Select]
$ sudo cp /Users/trev/laz-sources/tools/lazres /usr/local/bin/
$ rehash

Instead of cp it's usually better to use ln to create a symlink:
Code: [Select]
$ sudo ln -s /Users/trev/laz-sources/tools/lazres /usr/local/bin/lazres
$ rehash

That way if you modify/recompile/update lazres the link will automatically point to the new version. That's what I do in Linux for the ton of small tools I have: symlinks in /home/lucamar/bin point to the binaries in each project folder, at /home/lucamar/SoftDev/*
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2020
  • Former Delphi 1-7, 10.2 user

Instead of cp it's usually better to use ln to create a symlink

That way if you modify/recompile/update lazres the link will automatically point to the new version.

You are so right, that would definitely be a better option.

lestroso

  • Full Member
  • ***
  • Posts: 134
    • FaSasoftware
Thanks to everybody for your ideas...but unfortunetly i'm not succeded to work with your solution...

I don't know why is so difficult to run a command (Lazres) from Mac os x terminal....

For now i have tested Lazres on windows emulator (virtualbox Macosx) and goes very fine!!! i have created 14 sounds mp3 and putted them into a resource.res file ...

Thanks to wp friend, i have a real solution to play sounds cross-platform because those mp3 are stored in the resource file and stored inside the exe or app.

Ok ...if sombody have an easy idea to Play Lazres on Mac os x from terminal, i 'll thank you very much...Best regards,

Lestroso :-[

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2020
  • Former Delphi 1-7, 10.2 user
Ok ...if sombody have an easy idea to Play Lazres on Mac os x from terminal, i 'll thank you very much...Best regards,

Please tell us:

1) Lazarus version, FPC version, macOS version.
2) Exactly what you did (I'm assuming you followed the advice above, but please detail what you did);
3) What happened? Error messages, output, results.

Without this information we cannot help further. We can, however, confirm that it does work on macOS as I demonstrated above.

dbannon

  • Hero Member
  • *****
  • Posts: 2778
    • tomboy-ng, a rewrite of the classic Tomboy

lestroso , here is very specific instructions needed to get help.  Please cd to the directory you are working in, type ls <enter> and then the lasres command you are using, <enter>.

Now, with the mouse, select all the text on screen back up to and including the ls command, hit <command> C to copy it and paste that into a forum message.

We need to see the command you type and its output for both ls and the lasres command.

Thanks mate !

Davo

Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

lestroso

  • Full Member
  • ***
  • Posts: 134
    • FaSasoftware
Thank you to everybody but again many thanks to WP!!!! I HAVE putted this "./" and it works fine!!! Below there's the code example


Code: Pascal  [Select][+][-]
  1. iMac-di-PIPPO:~ pippo$ cd desktop
  2. iMac-di-PIPPO:desktop pippo$ cd lazres
  3. iMac-di-PIPPO:lazres pippo$ ./lazres resorce.res sound1.wav sound2.wav
  4. sound1.wav ResourceName='sound1' Type=RT_RCDATA
  5. sound2.wav ResourceName='sound2' Type=RT_RCDATA
  6. iMac-di-PIPPO:lazres pippo$
  7.  

I'm sorry, i'm a beginner...but i'm lucky because there're friends like you!!!eheheh best regards,
Lestroso :D

dbannon

  • Hero Member
  • *****
  • Posts: 2778
    • tomboy-ng, a rewrite of the classic Tomboy

lestroso, great that you have it working but I am not sure you are working in the best possible manner.

The './' in front of an executable's name indicates you want to use the executable in the current working directory.  As you have not set a path to the two wav files, its implied they are also in the current working directory.

As a general rule, in *nix we try to keep data and executable files in different places. In your case, the lazres executable should be where you first installed it (or built it if you build lazarus from source). It sits safely there out of the way until needed. *nix does not normally look for an executable in your working directory because thats where you have your data file, perhaps files that change a lot, maybe ones you are editing.

So, from what you say above, it looks to me like you have copied lazres (the executable) from where you first started into that director called lasres ?  And put your wav files in there too ?

Far better, IMHO, to have just your working data files in there, the two wav files plus whatever else you are working on. And, when you call set a path to where ever lasres is.

I built Lazarus from source on Mac and I don't have my Mac with me but from memory (dodgy), I'd something like -

~/bin/Lazarus/lazarus_2_0_4/tools/lazres  resorce.res  sound1.wav  sound2.wav

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

lestroso

  • Full Member
  • ***
  • Posts: 134
    • FaSasoftware
Dear dbannon,

yes, i have created a new folder called lazres....and inside i have copied the 2 sounds....i have made that for pleasure..to work best with sounds.....

and putted that folder in desktop....Ok..i have used "./" to work with lazres.exe or lazres.app ....i'm sorry if it is not the right solution...but it works very fine...

Best regards,

Lestroso :D

 

TinyPortal © 2005-2018