[SLVD]THashmap Error: undefined reference to `GHASHMAP$_$THASHMAP$3_$__$$_CREATE lazarus / 34-Windows ---------------------------------------------------------------------- zbyna · 2016-08-03 20:05 I have problem to use Thashmap from fcl-stl. Tried everything from: http://forum.lazarus.freepascal.org/index.php?topic=22019.0 without progress. Any help appreciated. Code: [Select]Lazarus version: 1.7 Lazarus svn revision: 52701M Lazarus build date: 2016/07/17 Lazarus was compiled for i386-win32 Lazarus was compiled with fpc 3.1.1 Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i Compile Project, Target: project1.exe: Exit code 1, Errors: 3E:\Dokumenty_ZbynA\Lazarus - Pokusy\genres-pokus- lazarus\lib\i386-win32\unit1.o: In function `TFORM1__BTNPARSUJCLICK':unit1.pas(63,1) Error: undefined reference to `VMT_$GHASHMAP_$$_THASHMAP$3'unit1.pas(63,1) Error: undefined reference to `GHASHMAP$_$THASHMAP$3_$__$$_CREATE$$THASHMAP$3'project1.lpr(20,1) Error: Error while linking http://i.imgur.com/lPC8H4Yl.jpg Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i unit Unit1; {$mode objfpc}{$H+} interface uses  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,  Grids, simpleinternet, extendedhtmlparser, xquery, xquery_json,ghashmap; type   { ProHash }   ProHash = class    public    class function hash(a:LongInt;b:LongInt):LongInt;  end;   HashTabulka = specialize THashmap;   { TForm1 }   TForm1 = class(TForm)    btnParsuj: TButton;    memJSON: TMemo;  stgGenres: TStringGrid;    procedure btnParsujClick(Sender: TObject);  private    { private declarations }  public    { public declarations }  end; var  Form1: TForm1;  tabulka: hashTabulka; implementation {$R *.lfm} { forHash } class function proHash.hash(a: LongInt; b: LongInt): LongInt;begin  hash:=a mod b;end; { TForm1 } procedure TForm1.btnParsujClick(Sender: TObject);var  w,v:IXQValue;  i: Integer;  cislo: Int64;  nazevGenre: String;begin  w:=process('file://movidedb-genres-film.json',            '$json("genres")() ! [.("id"), .("name")]');  memJSON.Text:=w.jsonSerialize(tnsText);  i:=0;  tabulka:=THashmap.create;  stgGenres.RowCount:=w.Count;  for v in w do   begin     cislo:=(v as TXQValueJSONArray).seq.get(0).toInt64;     nazevGenre:=(v as TXQValueJSONArray).seq.get(1).toString;     stgGenres.Cells[0,i]:=inttostr(cislo);     stgGenres.Cells[1,i]:=nazevGenre;     tabulka.insert(cislo,nazevGenre);     i:=i+1;   end;  stgGenres.Columns.Items[1].Width:=stgGenres.Width - 10 -                                  stgGenres.Columns.Items[0].Width;end; end.         Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i program project1; {$mode objfpc}{$H+} uses  {$IFDEF UNIX}{$IFDEF UseCThreads}  cthreads,  {$ENDIF}{$ENDIF}  Interfaces, // this includes the LCL widgetset  Forms, Unit1  { you can add units after this }; {$R *.res} begin  RequireDerivedFormResource:=True;  Application.Initialize;  Application.CreateForm(TForm1, Form1);  Application.Run;end. ---------------------------------------------------------------------- zbyna · 2016-08-04 00:58 OK Error between table and keyboard       line 63: Instead of:Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i  tabulka:=THashmap.create;should be:Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i tabulka:=HashTabulka.create; good experience: not to be horrified by complicated error messages  like Error: undefined reference to `GHASHMAP$_$THASHMAP$3_$__$$_CREATE$$THASHMAP$3' ---------------------------------------------------------------------- Cyrax · 2016-08-05 05:56 You should prefix all your type names with T. ---------------------------------------------------------------------- zbyna · 2016-08-07 17:30 Quote from: Cyrax on August 05, 2016, 07:56:07 amYou should prefix all your type names with T. Yes, I should but I got used to use: https://github.com/raywenderlich/swift-style-guide#naming from objC and swift ---------------------------------------------------------------------- Leledumbo · 2016-08-08 19:21 Quote from: zbyna on August 07, 2016, 07:30:35 pmYes, I should but I got used to use: https://github.com/raywenderlich/swift-style-guide#naming from objC and swift Get used to Pascal style, you will get trapped by the case sensitivity of that other two languages sooner or later (see the example for UrlString. Or was it urlString? Perhaps URLString? Nah, I forgot). ---------------------------------------------------------------------- zbyna · 2016-08-15 16:29 Quote from: Leledumbo on August 08, 2016, 09:21:03 pmQuote from: zbyna on August 07, 2016, 07:30:35 pmYes, I should but I got used to use: https://github.com/raywenderlich/swift-style-guide#naming from objC and swift Get used to Pascal style, you will get trapped by the case sensitivity of that other two languages sooner or later (see the example for UrlString. Or was it urlString? Perhaps URLString? Nah, I forgot). I think it is solved in document which link I have already posted: Abbreviations and acronyms should generally be avoided. Following the API Design Guidelines, abbreviations and initialisms that appear in all uppercase should be uniformly uppercase or lowercase.  Examples: Preferred Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i urlString: URLStringuserID: UserID Not Preferred Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i uRLString: UrlStringuserId: UserId