Welcome, Guest
Username: Password: Remember me
Welcome to the XSharp forum!

Tell us and our members who you are, what you like and why you became a member of this site.
We welcome all new members and hope to see you around a lot!
  • Page:
  • 1
  • 2

TOPIC:

File not found bclasses.ico 06 Mar 2021 11:10 #17649

  • Hollo2712
  • Hollo2712's Avatar
  • Topic Author


  • Posts: 8
  • Hello at all,

    I am a liitle bit stupid, but I ported a VO-Project to XSHARP, using some external tools like BCLASSES. Now I get the error "C:\XIDE\Projects\wsVereinX\bDefines\Version (Info).rc(1) : error RC2135 : file not found: BCLASSES.ICO". The responding Sourceline is _BICOCLASSES ICON BCLASSES.ICO

    Now I can't get any Info of how the XIDE resoveses thist file name with some Variable Path from the Project. I alrready tried to copy the necessary files in some directories in the project-path and/or used %ProjectPath%. But this error remains.
    There must be something I do not recognize to set the right path for Resource-Files like Icons.

    Can anyone give me a hint.

    Many thanks

    Horst

    Please Log in or Create an account to join the conversation.

    File not found bclasses.ico 06 Mar 2021 11:48 #17651

    • wriedmann
    • wriedmann's Avatar


  • Posts: 3094
  • Hi Horst,
    please open that file (C:\XIDE\Projects\wsVereinX\bDefines\Version (Info).rc) and look where the file is expected.
    Wolfgang
    Wolfgang Riedmann
    Meran, South Tyrol, Italy

    www.riedmann.it - docs.xsharp.it

    Please Log in or Create an account to join the conversation.

    File not found bclasses.ico 07 Mar 2021 08:08 #17669

    • Hollo2712
    • Hollo2712's Avatar
    • Topic Author


  • Posts: 8
  • Hi Wolfgang,

    this is the point: I don't know how to change the source in a manner, that the compiler finds the icon. The question is, which search-path is used by the compiler and which envrionmental variables ca be used to subreference a dircectory relative to the project path.
    As mentioned I tried the following: "_BICOCLASSES ICON %ProjectPath%\BCLASSES.ICO" - this didn't work. I changed the Project Properties to relative Addressing, but I saw nothing changed.

    Horst

    Please Log in or Create an account to join the conversation.

    File not found bclasses.ico 07 Mar 2021 10:11 #17670

    • Chris
    • Chris's Avatar


  • Posts: 3405
  • Hi Horst,

    This source (.rc files) is passed directly to the resource compiler (rc.exe), so it is not possible to use the %% macros in there, instead you need to use a path relative to the Resources folder of your app (this is where all the .rc files of the app get collected and compiled all together - a rc.exe limitation).

    In which folder is the .ico file actually located in your disk?
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    File not found bclasses.ico 01 Aug 2022 07:35 #23167

    • JohnBonnett88
    • JohnBonnett88's Avatar


  • Posts: 13
  • Hi Chris,

    I have this same problem. I had a line like this in a .rc file
    BICOCLASSES Icon C:\Users\XVJBONNE\source\repos\LabPro\Icons\bClasses.ico

    And tried changing to a relative path to work for any user
    BICOCLASSES Icon ..\..\Icons\bClasses.ico

    I got an error
    error RC2142: ellipsis requires three periods

    And tried
    BICOCLASSES Icon ...\...\Icons\bClasses.ico

    And got the same error. I am currently assuming the resource compiler is running where the resource file is.

    Is there documentation for the resource compiler?

    Keep up the good work,
    John

    Please Log in or Create an account to join the conversation.

    File not found bclasses.ico 01 Aug 2022 09:44 #23168

    • Chris
    • Chris's Avatar


  • Posts: 3405
  • Hi John,

    You can try from the command prompt rc.ece /? to see some info, but this tool (from MS) is very badly documented and extremely fragile unfortunately.
    In your case, I think the problem is the backslashes, the texts are treated as c-like strings, so you need to double the slashes, as in:

    BICOCLASSES Icon C:\\Users\\XVJBONNE\\source\\repos\\LabPro\\Icons\\bClasses.ico

    Also the relative path version should work the same way.

    In case it doesn't, can you please and make sure that the format of the .rc file is ANSI? If it's UTF/Unicode etc, then it is very common for unexplainable errors like those to appear.
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    File not found bclasses.ico 02 Aug 2022 02:07 #23180

    • JohnBonnett88
    • JohnBonnett88's Avatar


  • Posts: 13
  • Thanks Chris,

    With your help, I have made some progress. I changed the code to
    BICOCLASSES Icon ...\\...\\Icons\\bClasses.ico

    It seems to want the 3 dots, and now I get this error
    error RC2135: file not found: ...\\...\\Icons\\bClasses.ico

    Now that could mean that path is nonsense, or perhaps it is recognizing it as a proper relative path, but it is not the right one.

    When rc.exe is running, what folder is it in?

    Thanks again,
    John

    Please Log in or Create an account to join the conversation.

    File not found bclasses.ico 02 Aug 2022 04:00 #23181

    • JohnBonnett88
    • JohnBonnett88's Avatar


  • Posts: 13
  • Hi Chris,

    I have resolved my problem, so here is some feedback in case it helps someone else.

    I found some documentation of the resource compiler here docs.microsoft.com/en-us/windows/win32/menurc/resource-compiler

    The documentation of the Icon statement said the file name should be a quoted string, even though their examples on the same page showed them without quotes. When you do use quotes, you don't need to double the backslashes or use "...".

    I also had a mistake of my own, the relative path was wrong! It looks like the resource compiler runs in the folder where the *.rc file is, so the code that worked in my case was:
    BICOCLASSES Icon "..\Icons\bClasses.ico"

    Thanks again for your help,
    John

    Please Log in or Create an account to join the conversation.

    File not found bclasses.ico 02 Aug 2022 06:58 #23182

    • Chris
    • Chris's Avatar


  • Posts: 3405
  • Hi John,

    Glad you have it working and thanks for the detailed info!

    .
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    File not found bclasses.ico 02 Aug 2022 08:26 #23189

    • robert
    • robert's Avatar


  • Posts: 2974
  • John,
    Try to use single backslashes and put double quotes around the filename.

    Robert
    XSharp Development Team
    The Netherlands

    Please Log in or Create an account to join the conversation.

    File not found bclasses.ico 03 Aug 2022 06:48 #23205

    • JohnBonnett88
    • JohnBonnett88's Avatar


  • Posts: 13
  • Thanks Robert,
    After a bit of fiddling I came to that conclusion too, and have adopted it.
    John

    Please Log in or Create an account to join the conversation.

    File not found bclasses.ico 11 Aug 2022 06:52 #23252

    • JohnBonnett88
    • JohnBonnett88's Avatar


  • Posts: 13
  • Hi Chris (& Robert),
    I spoke too soon when I thought I had fixed my problem. The particular problem I showed in my previous emails is fixed and I implemented the change in all the other .rc files throughout my solution. Unfortunately I did not rebuild everything. When I tried rebuilding one other project it failed in a similar way.

    I have a line like this
    ACLIENT_IMAGE Icon "..\Icons\AClient.ICO"

    and on building, it fails like this:
    error RC2135: file not found: ..\IconsClient.ICO

    It seems to be converting that "\A" into a BS (backspace) character! The earlier "\" in the string does not cause a problem.

    I tried doubling the "\" before the A and that is even more puzzling
    error RC2135: file not found: ..\Iconstt1.ico

    There is still a single BS in the error and I am not sure where the "tt1" came from! Something strange going on inside the resource compiler!

    Any suggestions welcome.

    John

    Please Log in or Create an account to join the conversation.

    File not found bclasses.ico 11 Aug 2022 07:09 #23254

    • Chris
    • Chris's Avatar


  • Posts: 3405
  • Hi John,

    This should had worked, are you sure you did a Rebuild after making that change?
    Also are you sure the file indeed exists in that relative path? What if you use an absolute path, does it work this way?

    If all fails, can you please zip and post a sample reproducing the problem, so we can have a look?
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    File not found bclasses.ico 11 Aug 2022 07:49 #23256

    • JohnBonnett88
    • JohnBonnett88's Avatar


  • Posts: 13
  • Thanks Chris,

    I see in the mailing list you do not see that BS character embedded, but you can see it seems to have lost some characters, and in some cases found some spurious ones.

    I think my solution will be to forget about the relative paths, and put the icon files with each project that uses them, so the paths will be simple.

    The examples in the resource compiler doco only show local paths like that.

    I see that for C# projects the resource compiler does not get used. The resources and settings are managed through special C# files.

    Thanks again,
    John

    Please Log in or Create an account to join the conversation.

    File not found bclasses.ico 11 Aug 2022 10:09 #23259

    • Chris
    • Chris's Avatar


  • Posts: 3405
  • Hi John,

    I did test it here and it works also with relative paths (after putting double slashes), that's why I asked for a sample showing the problem. But, yeah, absolute paths are also fine, if you do not plan to be moving the solution to different folders, PCs etc.
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    File not found bclasses.ico 11 Aug 2022 10:43 #23260

    • leon-ts
    • leon-ts's Avatar


  • Posts: 199
  • Hi guys,
    All image resources in my X# application refer to the source using a relative path. I confirm the words of Chris - there are no problems with this.

    Example from my project:
    Db32Icon ICON "..\\..\\RES\\DB32.ICO"
    Doc16Icon ICON "..\\..\\RES\\DOC16.ICO"
    EditDoc16Icon ICON "..\\..\\RES\\EDITDOC16.ICO"
    ...

    Solution structure:
    Attachments:

    Please Log in or Create an account to join the conversation.

    Last edit: by leon-ts.

    File not found bclasses.ico 11 Aug 2022 11:00 #23261

    • leon-ts
    • leon-ts's Avatar


  • Posts: 199
  • John,
    Maybe there is some problem with the character encoding? If the rc file was created as a result of automatic transport, then try recreating the rc file and re-entering the path to the resource manually.

    Best regards,
    Leonid

    Please Log in or Create an account to join the conversation.

    File not found bclasses.ico 12 Aug 2022 04:04 #23266

    • JohnBonnett88
    • JohnBonnett88's Avatar


  • Posts: 13
  • Thanks Leonid,
    That is a good suggestion but I seem to be able to work with the file in VS and Notepad++ without any issues and it has been edited by both several times.

    As I mentioned previously, I started with a line like this:
    ACLIENT_IMAGE Icon "..\Icons\AClient.ICO"

    When I tried doubling the backslashes, I got an error like this from rc:
    error RC2135: file not found: ..\Iconstt1.ico

    There is a BS character between the s and the first t in the message but that may get swallowed in the forum. That "tt1" seemed quite spurious, but I have now found out where that probably came from.

    I moved the .ICO file to be with the relevant .RC file and changed the line to:
    ACLIENT_IMAGE Icon "AClient.ICO"

    That worked fine, but there are other .RC files in the project so it failed on the next one, which had this in it:
    ATT1_ICON Icon "..\Icons\Att1.ico"

    and the error message was identical to that above, despite the icon files having different names. That is possibly where the spurious "tt1" came from! I think the RC program is having troubles internally keeping separate files from being tangled.

    I will try to cook up a baby example that shows the problem.

    John

    Please Log in or Create an account to join the conversation.

    File not found bclasses.ico 12 Aug 2022 06:47 #23269

    • Chris
    • Chris's Avatar


  • Posts: 3405
  • Hi John,

    You need to add double back slashes, otherwise indeed the resource compiler translates "special" character sequences as such. Also being able to edit the file with other editors does not necessarily mean that the resource compiler can accept it, too. Other editors can handle any encoding formats, while the resource compiler only accepts text files in ansi format (and unfortunately gives no descriptiveerror message at all, when a file is not such, it just fails with cryptic messages).

    But I do not think this is the actual problem, most likely it's just a path or the text in the quotes that's causing the trouble. If you can post a small sample, we will be able to tell you exactly what's the problem.
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    File not found bclasses.ico 16 Aug 2022 06:45 #23308

    • JohnBonnett88
    • JohnBonnett88's Avatar


  • Posts: 13
  • Hi All,

    I started to look at if I could produce a small example of my problem with the relative paths for icon files but have discovered it is all a bit more complicated that it seemed.
    I had relative paths like this:
    _RXLAB Icon "..\Icons\RxLab.ICO"

    I have just discovered that not all of them were giving me an error. The project containing that line above still build without error.

    Where I had a build error, I change the code to be like this:
    A_CLIENT Icon "AClient.ICO"
    and copied the ICO file to be in the same folder as the .RC file that referenced it.

    On doing a full search through all the RC files in my solution, I can find examples like this, as well as the examples above:
    A_CLIENT Icon C:\LabPro\AClient.ICO
    101 ICON \Appwiz\WINS.ICO
    ICONKILSOFT ICON C:\Users\XVJBONNE\source\repos\LabPro\Icons\KILSOFT.ICO
    ICONKILSOFT ICON C:\CAVO25\BIN\KILSOFT.ICO

    These all seem to be building OK, despite there being no \Appwiz folder, and although C:\LabPro exists, it has no icons in it. C:\CAVO25 does not exist either. That long path above is correct, but you will notice none of these are quoted, and there are no double backslashes in sight!

    I will report back if I discover anything new.

    John

    Please Log in or Create an account to join the conversation.

    • Page:
    • 1
    • 2