CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2005
    Posts
    5

    Smile How to represent variable with space in MAKEFILE

    I want to include a library directory in a makefile:

    C:/program file/ ../...

    then How to represent the space in "program file"

    I tried define ABC="C:/program file"
    and add "\"after "program", but neither works.

  2. #2
    Join Date
    Jun 2005
    Posts
    1,255

    Smile Re: How to represent variable with space in MAKEFILE

    Can you post the full line, because, for instance I have the following line which is working well although it contains quotes:
    Code:
    LIBS =  -L"C:/DEV-CPP/lib" -mwindows -lcomctl32
    Edit: Maybe the problem is with the final "s" in "C:/Program Files"
    Last edited by olivthill; November 22nd, 2005 at 08:31 AM.

  3. #3
    Join Date
    Oct 2005
    Posts
    5

    Talking Re: How to represent variable with space in MAKEFILE

    thanks for your reply ^_^
    Code:
    MATLAB_LIBS = \
    C:\PROGRAM FILES\MATLAB704\extern\lib\win32\microsoft\msvc71\libmx.lib
    error message is:
    Code:
    LINK: fatal error LNK1181: cannot open input file "C: \PROGRAM.OBJ"
    NMAKE:fatal error u1077: 'cl': return code '0X2'
    Last edited by yinkou; November 22nd, 2005 at 09:36 AM.

  4. #4
    Join Date
    Nov 2003
    Location
    Belgium
    Posts
    8,150

    Re: How to represent variable with space in MAKEFILE

    The following should work i think:
    Code:
    MATLAB_LIBS = \
    "C:\PROGRAM FILES\MATLAB704\extern\lib\win32\microsoft\msvc71\libmx.lib"
    Marc Gregoire - NuonSoft (http://www.nuonsoft.com)
    My Blog
    Wallpaper Cycler 3.5.0.97

    Author of Professional C++, 4th Edition by Wiley/Wrox (includes C++17 features)
    ISBN: 978-1-119-42130-6
    [ http://www.facebook.com/professionalcpp ]

  5. #5
    Join Date
    Feb 2005
    Location
    Pasadena, MD, USA
    Posts
    105

    Re: How to represent variable with space in MAKEFILE

    Hi yinkou,

    The following should also work (I've used it during scripting, but I like the long file names also).
    Code:
    C:\>dir /X
    Volume in drive C has no label.
    Volume Serial Number is 58AC-2403
    Directory of C:\
    11/04/2005 09:21 AM	<DIR>		 CRYPTO~2.1 Crypto++ 5.2.1
    10/04/2005 01:14 PM	<DIR>					 dell
    10/07/2005 08:21 AM	<DIR>		 DOCUME~1	 Documents and Settings
    ...
    09/04/2003 12:59 PM			17,590			 PkgClnup.log
    11/07/2005 03:15 PM	<DIR>		 POLICY~1	 Policy Backups
    11/17/2005 04:38 PM	<DIR>		 PROGRA~1	 Program Files
    10/21/2005 10:53 AM	<DIR>		 RDP5~1.2MS RDP 5.2 MSI Installer
    Now that you have the short name:
    Code:
    MATLAB_LIBS = \
    C:\PROGRA~1\MATLAB704\extern\lib\win32\microsoft\msvc71\libmx.lib
    Jeff

  6. #6
    Join Date
    Oct 2005
    Posts
    5

    Thumbs up Re: How to represent variable with space in MAKEFILE

    Code:
    MATLAB_LIBS = \
    C:\PROGRA~1\MATLAB704\extern\lib\win32\microsoft\msvc71\libmx.lib
    I replaced "program files" with "PROGRA~1" and it works~~^_^
    Thank you Jeffrey,Marc G and olivthill~~~~

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured