Recent

Author Topic: [Solved] Help needed compiling  (Read 1710 times)

jamie

  • Hero Member
  • *****
  • Posts: 7610
Re: Help needed compiling
« Reply #15 on: February 13, 2026, 02:33:02 am »
Ok, I got it to compile and execute, after fixing some bad Dynamic byte Array READ from the avr.ini file.

I also placed a compiler version check to get around the issue of unsupported properties in the TfpHttpServer which apparently wasn't needed.

I did not fix the SQL.RC file because its a simple thing to do for those that really want  it but I did get a report from Windows Defender indicating it was blocking some features of the app, So I can say that have graduated to a HACKER?  :o

Code: Pascal  [Select][+][-]
  1. // In the COMMON file.
  2. function CalcFileCRC32(AFileName: string): Cardinal;
  3. var
  4.  Buffer : TBytes;
  5. begin
  6.   Result:=CRC32(0,nil,0);
  7.   with TFileStream.Create(AFileName, fmOpenRead or fmShareDenyNone) do
  8.     try
  9.       SetLength(Buffer, Size);
  10.       Read(Buffer[0],Size); //<< Change this to BUFFER[0].
  11.       Result:=CRC32(Result,@Buffer[0],Size);
  12.     finally
  13.       Free;
  14.     end;
  15. end;                                        
  16.  

I just commented out the resource file name for now. those who are interested can fix it, they SQL files are there already unzipped in the SQL folder.

This is with Fpc 3.2.2

Jamie


The only true wisdom is knowing you know nothing

broutelichen

  • Newbie
  • Posts: 6
Re: Help needed compiling
« Reply #16 on: February 14, 2026, 11:49:59 am »
Hello Jamie,

i'm editing the source code 1.2.6 of the project  with Lazarus version 4.4 and FPC 3.2.2

i replaced in src/common.pas :
Code: Pascal  [Select][+][-]
  1. function CalcFileCRC32(AFileName: string): Cardinal;
  2. var
  3.   Buffer : TBytes;
  4. begin
  5.   Result:=CRC32(0,nil,0);
  6.   with TFileStream.Create(AFileName, fmOpenRead or fmShareDenyNone) do
  7.     try
  8.       SetLength(Buffer, Size);
  9.       Read(Buffer,Size);
  10.       Result:=CRC32(Result,@Buffer[0],Size);
  11.     finally
  12.       Free;
  13.     end;
  14. end;


by your code :

Code: Pascal  [Select][+][-]
  1. function CalcFileCRC32(AFileName: string): Cardinal;
  2. var
  3.  Buffer : TBytes;
  4. begin
  5.   Result:=CRC32(0,nil,0);
  6.   with TFileStream.Create(AFileName, fmOpenRead or fmShareDenyNone) do
  7.     try
  8.       SetLength(Buffer, Size);
  9.       Read(Buffer[0],Size); //<< Change this to BUFFER[0].
  10.       Result:=CRC32(Result,@Buffer[0],Size);
  11.     finally
  12.       Free;
  13.     end;
  14. end;

and saved the file

i also modified in translator.pas :

Code: Pascal  [Select][+][-]
  1.  case Integer(LUnicode.Words[0]) of

by this :

Code: Pascal  [Select][+][-]
  1. case WOrd(LUnicode {.Words[0]}) of

and i still can't get an exe file:

i can see in the console:

warning windres: can't open file 'RBDB_SQL_CREATE_IDX.zip' no such file or directory
Error: error while compiling resources: compile with -vd for more detail


and like you noticed, the dev stopped to compile windows file because windows defender report an issue.

i though i just could zip the file , located in src\sql
but nothing changed.. what a mess  >:D
« Last Edit: February 14, 2026, 11:53:52 am by broutelichen »

jamie

  • Hero Member
  • *****
  • Posts: 7610
Re: Help needed compiling
« Reply #17 on: February 14, 2026, 03:58:08 pm »
You need to learn a little about resources, not much but a little.

Attached is a modified version of the resource that you store in the "src\sql\" folder of the project.
Since these have been already suppled.

and in the "RadiobrowserDB" file at the top change the paths for the resources to this.

{$R ..\src\sql\sql.rc}

at least for windows, otherwise use "/"

P.S.
 I couldn't attach it so here is a paste in
Quote
RBDB_SQL_CREATE_IDX   RCDATA "RBDB_SQL_CREATE_IDX.sql"
RBDB_SQL_CREATE_REIDX   RCDATA "RBDB_SQL_CREATE_REIDX.sql"
RBDB_SQL_CREATE_TABLES   RCDATA "RBDB_SQL_CREATE_TABLES.sql"
RBDB_SQL_CREATE_VIEW_AVR   RCDATA "RBDB_SQL_CREATE_VIEW_AVR.sql"
RBDB_SQL_DROP_VIEW_AVR   RCDATA "RBDB_SQL_DROP_VIEW_AVR.sql"
RBDB_SQL_FIX_DATA   RCDATA "RBDB_SQL_FIX_DATA.sql"
RBDB_SQL_INSERT_CODECS   RCDATA "RBDB_SQL_INSERT_CODECS.sql"
RBDB_SQL_INSERT_COUNTRIES   RCDATA "RBDB_SQL_INSERT_COUNTRIES.sql"
RBDB_SQL_INSERT_LANGUAGES   RCDATA "RBDB_SQL_INSERT_LANGUAGES.sql"
RBDB_SQL_INSERT_STATIONS   RCDATA "RBDB_SQL_INSERT_STATIONS.sql"
RBDB_SQL_INSERT_TAGS   RCDATA "RBDB_SQL_INSERT_TAGS.sql"
RBDB_SQL_LIST_VIEWS   RCDATA "RBDB_SQL_LIST_VIEWS.sql"
RBDB_SQL_SELECT_CATEGORY   RCDATA "RBDB_SQL_SELECT_CATEGORY.sql"
RBDB_SQL_SELECT_ROOT   RCDATA "RBDB_SQL_SELECT_ROOT.sql"
RBDB_SQL_SELECT_STATION   RCDATA "RBDB_SQL_SELECT_STATION.sql"
RBDB_SQL_SELECT_STATIONS   RCDATA "RBDB_SQL_SELECT_STATIONS.sql"
RBDB_SQL_VERSION   RCDATA "RBDB_SQL_VERSION.sql"

Save that as a sql.rc in the src\sql folder.


Jamie



The only true wisdom is knowing you know nothing

broutelichen

  • Newbie
  • Posts: 6
Re: Help needed compiling
« Reply #18 on: February 15, 2026, 01:51:53 pm »
thank you so much, i do finally manage to compile that  >:D project
 i used FPCupdeluxe (thank you for the advice) FPC : 3.3.1 and Lazarus Stable version 4.4

and , of course, edited files with your advices, Jamie.

i think this thread can be closed.
i'm going to post a write up directly on the github's project to explain how to compile and of course, post a link (to this thread)
 ;D


valdir.marcos

  • Hero Member
  • *****
  • Posts: 1186
Re: Help needed compiling
« Reply #19 on: February 16, 2026, 07:34:09 am »
You need to learn a little about resources, not much but a little.

Attached is a modified version of the resource that you store in the "src\sql\" folder of the project.
Since these have been already suppled.

and in the "RadiobrowserDB" file at the top change the paths for the resources to this.

{$R ..\src\sql\sql.rc}

at least for windows, otherwise use "/"

P.S.
 I couldn't attach it so here is a paste in
Quote
RBDB_SQL_CREATE_IDX   RCDATA "RBDB_SQL_CREATE_IDX.sql"
RBDB_SQL_CREATE_REIDX   RCDATA "RBDB_SQL_CREATE_REIDX.sql"
RBDB_SQL_CREATE_TABLES   RCDATA "RBDB_SQL_CREATE_TABLES.sql"
RBDB_SQL_CREATE_VIEW_AVR   RCDATA "RBDB_SQL_CREATE_VIEW_AVR.sql"
RBDB_SQL_DROP_VIEW_AVR   RCDATA "RBDB_SQL_DROP_VIEW_AVR.sql"
RBDB_SQL_FIX_DATA   RCDATA "RBDB_SQL_FIX_DATA.sql"
RBDB_SQL_INSERT_CODECS   RCDATA "RBDB_SQL_INSERT_CODECS.sql"
RBDB_SQL_INSERT_COUNTRIES   RCDATA "RBDB_SQL_INSERT_COUNTRIES.sql"
RBDB_SQL_INSERT_LANGUAGES   RCDATA "RBDB_SQL_INSERT_LANGUAGES.sql"
RBDB_SQL_INSERT_STATIONS   RCDATA "RBDB_SQL_INSERT_STATIONS.sql"
RBDB_SQL_INSERT_TAGS   RCDATA "RBDB_SQL_INSERT_TAGS.sql"
RBDB_SQL_LIST_VIEWS   RCDATA "RBDB_SQL_LIST_VIEWS.sql"
RBDB_SQL_SELECT_CATEGORY   RCDATA "RBDB_SQL_SELECT_CATEGORY.sql"
RBDB_SQL_SELECT_ROOT   RCDATA "RBDB_SQL_SELECT_ROOT.sql"
RBDB_SQL_SELECT_STATION   RCDATA "RBDB_SQL_SELECT_STATION.sql"
RBDB_SQL_SELECT_STATIONS   RCDATA "RBDB_SQL_SELECT_STATIONS.sql"
RBDB_SQL_VERSION   RCDATA "RBDB_SQL_VERSION.sql"

Save that as a sql.rc in the src\sql folder.


Jamie
Very nice.

Zvoni

  • Hero Member
  • *****
  • Posts: 3315
Re: [Solved] Help needed compiling
« Reply #20 on: February 16, 2026, 08:08:04 am »
....and people laugh at me, when i say, i store my SQL-Statements in the Database itself.....
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

 

TinyPortal © 2005-2018