KiCad-Librarian icon indicating copy to clipboard operation
KiCad-Librarian copied to clipboard

Linux compilation

Open oafilipoai opened this issue 7 years ago • 4 comments

Hello,

I'm having some issues compiling in Linux. I'm using Debian Stretch and I get the error bellow when I try to compile. In cmake-gui I unchecked USE_CX3D since that library also has compilation errors. I also tried to run KiCad-Librarian with wine and that somewhat works, although some menus and selection boxes are misplaced or squashed and the 3D viewer does not work.

Any help is appreciated

/home/tavi/src/KiCad-Librarian/src/pdfreport.cpp:804:51: error: no matching function for call to ‘wxSortedArrayString::wxSortedArrayString(int (&)(const wxString&, const wxString&))’ wxSortedArrayString SortedIndex(CompareFootprint); ^ In file included from /usr/include/wx-3.0/wx/filefn.h:15:0, from /usr/include/wx-3.0/wx/utils.h:20, from /usr/include/wx-3.0/wx/cursor.h:69, from /usr/include/wx-3.0/wx/event.h:21, from /usr/include/wx-3.0/wx/window.h:18, from /usr/include/wx-3.0/wx/nonownedwnd.h:14, from /usr/include/wx-3.0/wx/toplevel.h:20, from /usr/include/wx-3.0/wx/frame.h:18, from /home/tavi/src/KiCad-Librarian/src/pdfreport.h:25, from /home/tavi/src/KiCad-Librarian/src/pdfreport.cpp:26:

oafilipoai avatar Sep 28 '17 20:09 oafilipoai

Change the file pdfreport.cpp, line 804 to this:

  wxSortedArrayString SortedIndex;
  for (wxStringToStringHashMap::iterator iter = FootprintIndex.begin(); iter != FootprintIndex.end(); iter++) {
    wxString line = iter->first + wxT(" : ") + iter->second;
    SortedIndex.Add(line);
  }
  SortedIndex.Sort(CompareFootprint);
  FootprintIndex.clear();

FabianInostroza avatar Jul 06 '18 06:07 FabianInostroza

This does not cure the problem. It just changes the error slightly:

~/Software/KiCad-Librarian/src/pdfreport.cpp: In member function ‘bool PdfReport::FootprintReport(wxWindow*, const wxString&, const wxArrayString&, const wxString&)’:
~/Software/KiCad-Librarian/src/pdfreport.cpp:809:36: error: no matching function for call to ‘wxSortedArrayString::Sort(int (&)(const wxString&, const wxString&))’
   SortedIndex.Sort(CompareFootprint);
                                    ^
In file included from /usr/include/wx-3.0/wx/filefn.h:15:0,
                 from /usr/include/wx-3.0/wx/utils.h:20,
                 from /usr/include/wx-3.0/wx/cursor.h:69,
                 from /usr/include/wx-3.0/wx/event.h:21,
                 from /usr/include/wx-3.0/wx/window.h:18,
                 from /usr/include/wx-3.0/wx/nonownedwnd.h:14,
                 from /usr/include/wx-3.0/wx/toplevel.h:20,
                 from /usr/include/wx-3.0/wx/frame.h:18,
                 from /home/adjco/Downloads/Software/KiCad-Librarian/src/pdfreport.h:25,
                 from /home/adjco/Downloads/Software/KiCad-Librarian/src/pdfreport.cpp:26:
/usr/include/wx-3.0/wx/arrstr.h:96:10: note: candidate: void wxSortedArrayString::Sort()
     void Sort()
          ^~~~
/usr/include/wx-3.0/wx/arrstr.h:96:10: note:   candidate expects 0 arguments, 1 provided
make[2]: *** [CMakeFiles/kicadlibrarian.dir/build.make:327: CMakeFiles/kicadlibrarian.dir/pdfreport.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:68: CMakeFiles/kicadlibrarian.dir/all] Error 2
make: *** [Makefile:152: all] Error 2

adjco avatar Oct 21 '18 16:10 adjco

@adjco Seems to depend on how the wxWidgets library was configured. It compiles fine on my system.

Try changing the type of SortedIndex (wxSortedArrayString) to wxArrayString, with that change it still compiles and work fine on my system (debian testing).

FabianInostroza avatar Oct 21 '18 19:10 FabianInostroza

That did the trick. Thank you Fabian, you're a star.

adjco avatar Oct 21 '18 19:10 adjco