Thread: Command line compile include libraries

  1. #1
    Registered User
    Join Date
    Dec 2007
    Posts
    932

    Command line compile include libraries

    Hi,

    How to specify the library path to the compiler instead of including them one by one, i have a lot of them.

    This is including them one by one:
    cl.exe myprogram.cpp "pathtolib"\user32.lib "pathtolib"\advapi32.lib

    Is there a way to just specify the lib folder?

    I know that if i use the MSVC command line i dont need to include them but i want to pass by a batch file and there is no way to call the
    MSVC cli by cmd.
    Using Windows 10 with Code Blocks and MingW.

  2. #2
    Registered User hk_mp5kpdw's Avatar
    Join Date
    Jan 2002
    Location
    Northern Virginia/Washington DC Metropolitan Area
    Posts
    3,817
    Search your compiler's documentation for command line arguments... perhaps the /LIBPATH option?
    "Owners of dogs will have noticed that, if you provide them with food and water and shelter and affection, they will think you are god. Whereas owners of cats are compelled to realize that, if you provide them with food and water and shelter and affection, they draw the conclusion that they are gods."
    -Christopher Hitchens

  3. #3
    Registered User
    Join Date
    Dec 2007
    Posts
    932
    Thanks I already searched but couldnt find.

    /LIBPATH is a 2005 option not working with MSVC 2010.
    Using Windows 10 with Code Blocks and MingW.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to configure MSVC# for command line compile?
    By thetinman in forum C# Programming
    Replies: 2
    Last Post: 12-02-2008, 11:11 AM
  2. how to compile on the command line
    By majoub in forum C Programming
    Replies: 2
    Last Post: 04-23-2005, 07:40 AM
  3. What libnet libraries to include with compile?
    By failure_to in forum C Programming
    Replies: 3
    Last Post: 06-16-2004, 06:42 AM
  4. Borland Compiler: Compiling libraries from the command line
    By WHurricane16 in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 04-03-2002, 10:11 AM
  5. Replies: 4
    Last Post: 11-14-2001, 10:28 AM