Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^4: Attempt to embed Perl in C on Windows

by Anonymous Monk
on Dec 23, 2014 at 17:07 UTC ( [id://1111194]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Attempt to embed Perl in C on Windows
in thread Attempt to embed Perl in C on Windows

After further experimenting: Update:

The perl source file can be included if provided with full path with double backslash.

Am I right that the lib folder from the project can be included for cl compiler on its command-line? The attempt with an empty lib folder produced no error.

I still cannot redirect the output of the cl compiler to the project folder :-(

  • Comment on Re^4: Attempt to embed Perl in C on Windows

Replies are listed 'Best First'.
Re^5: Attempt to embed Perl in C on Windows
by BrowserUk (Patriarch) on Dec 23, 2014 at 18:20 UTC
    How to set the output to a project directory (now the .exe is being saved in C:/windows/system32 which is not a good thing)?

    That is very weird! The exe gets placed in the current working directory (unless you tell it to do otherwise), so why are you running the command in C:/windows/system32?

    Personally, I always run the cl command in the project directory, and that's where the output goes; but if you really must place it somewhere else, you can use:

    /Fe<file> name executable file

    I assume you can specify a full path, though I've never tried it.

    See cl -help for a good usage screen.

    Am I right that the lib folder from the project can be included for cl compiler on its command-line?

    Yes. Use /LIBPATH:path

    See link /? for other linktime options that can be supplied to cl


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

      Thank you very much for your time! It works now with /Fe, I had to define /Fo as well.

      The reason for running in the windows dir was that I used the installed link to the command line of MSVC - it sets the path for c compiler in that cmd window only. It produced an error "cannot open an .obj file" at first, and I read in forum that I need to start it as admin to prevent this. It worked than, only it started in the win/system32 dir. One could possibly navigate in the project dir, but with the above flags it is solved. Thanks again!

        The reason for running in the windows dir was that I used the installed link to the command line of MSVC - it sets the path for c compiler in that cmd window only.

        If you right click the Start menu item for that shell, select Properties, the second edit field on the Shortcut tab is the 'Start in:' path, which you can change to point anywhere you want it.

        Come to that typing cd \path\to\MyProject once, is a lot quicker than type /Fe \path\to\MyProject\MyExe.exe /Fo \path\to\MyProject\myexe.obj ... everytime!


        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.
Re^5: Attempt to embed Perl in C on Windows
by Anonymous Monk on Dec 23, 2014 at 17:13 UTC
    The perl source file can be included if provided with full path with double backslash.

    Sorry it was a rapid shot, since I still need the perl source file at the runtime. The desired behavior were to pack the source file at the compile time. Is it possible?

      The desired behavior were to pack the source file at the compile time. Is it possible?

      What do you mean by "How to bind the perl source file" and/or "pack the source file"?

      Do you mean:

      1. Embed the path/name of the source file in the executable?
      2. Embed the contents of the source file in the executable?
      3. Other?

      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

        I meant "Embed the contents of the source file in the executable". Sorry for the ambiguity and thank you very much for your time.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1111194]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2024-04-25 23:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found