• Login
Community
  • Login

how to link the resource file with Nppexec?

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
6 Posts 4 Posters 1.8k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I
    imdjs
    last edited by Feb 24, 2018, 6:07 AM

    I know how to complie and link the C++ .cpp file into .exe. but I still can’t figure out how to link the .rc file with icon using the Nppexec plugin.
    here is my command line:
    cmd /k chdir /d $(CURRENT_DIRECTORY) &cl $(FILE_NAME) /Fo:$(NAME_PART).obj /c &EXIT
    cmd /k chdir /d $(CURRENT_DIRECTORY) &link $(NAME_PART).obj /OUT:$(NAME_PART).exe &EXIT

    but how can I add words to complie the .rc file with icon?
    my OS is windows10 x64 complier is vs 2013

    C 1 Reply Last reply Feb 24, 2018, 11:26 AM Reply Quote 0
    • C
      Claudia Frank @imdjs
      last edited by Feb 24, 2018, 11:26 AM

      @imdjs

      Afaik rc files can’t be compiled by normal source code compilers you need to use
      some kind of resource file compilers. I can’t remember its exact name it was something
      like winres.exe or windowsres.exe.
      Once you have the compiled resource file you provide it to the linker like any other file
      which should be linked.

      But, why do you use cmd /k?
      NppExec provides its own pseudo shell and you see the output in the NppExec console immediately.

      Cheers
      Claudia

      1 Reply Last reply Reply Quote 1
      • I
        imdjs
        last edited by Feb 25, 2018, 5:08 AM

        thank you for reply,
        I dont know much about what the command line means ,this is others tell me and it works except for link the .rc file

        1 Reply Last reply Reply Quote 0
        • V
          Vitaliy Dovgan
          last edited by Feb 27, 2018, 10:05 AM

          Looking at the provided examples for .cpp files, the one for .rc file should look similar to:
          cmd /k chdir /d $(CURRENT_DIRECTORY) &rc /r Resource.rc /Fo:Resource.res &EXIT

          Note: the executable “rc” is located under %ProgramFiles%\Microsoft SDKs\Windows\v7.1A\bin rather than under %ProgramFiles%\Microsoft Visual Studio 12.0\VC\bin where “cl” and “link” are located, so you may need to add %ProgramFiles%\Microsoft SDKs\Windows\v7.1A\bin to the %PATH%.
          Also, the resource compilation must be the very first command, and then the call to “cl” should include this compiled resource file, similar to:
          cmd /k chdir /d $(CURRENT_DIRECTORY) &cl $(FILE_NAME) /Fo:$(NAME_PART).obj Resource.res /c &EXIT

          If this does not work from the first attempt, please ask the others’ help (the ones mentioned by you), they should know :)

          1 Reply Last reply Reply Quote 1
          • I
            Imdjs FX
            last edited by Mar 15, 2018, 4:13 AM

            @Vitaliy Dovgan
            thank you for reply ,I found that the command line: cmd /k chdir /d $(CURRENT_DIRECTORY) &rc /r Resource.rc /Fo:Resource.res &EXIT is not working pop up(fatal error RC1107: invalid usage; use RC /? for Help) but if I change it to: cmd /k chdir /d $(CURRENT_DIRECTORY) &rc /r Resource.rc &EXIT then it works but I can’t sepecify the output directory with /Fo: ,however this is nothing big deal.

            thanks

            1 Reply Last reply Reply Quote 0
            • I
              Imdjs FX
              last edited by Mar 15, 2018, 7:54 AM

              SET local MSSDK = E:/Microsoft Visual Studio 12.0/VC/Microsoft SDKs/Windows/v7.1A
              ENV_SET PATH =$(MSSDK)/bin/x64;$(SYS.PATH)
              SET local B_DIR = B:/$(NAME_PART)

              cmd /k chdir /d $(CURRENT_DIRECTORY) &rc /r /v /fo $(B_DIR).res $(NAME_PART).rc &EXIT

              //----------------------------------------------
              I finally figure out how to complie the .rc file with the sepecify output directory

              1 Reply Last reply Reply Quote 2
              • First post
                Last post
              The Community of users of the Notepad++ text editor.
              Powered by NodeBB | Contributors