Topic
  • 6 replies
  • Latest Post - ‏2012-02-23T09:37:32Z by Yevo
oeakdemir
oeakdemir
144 Posts

Pinned topic expanded command line too long

‏2012-02-18T21:24:32Z |
I face with a problem in linking phase, while working with MSVC9 configuration. It says:

NMAKE : fatal error U1095: expanded command line 'link.exe ....' too long
, where ... denotes many obj files and other arguments.

Anyone to help ?
Updated on 2012-02-23T09:37:32Z at 2012-02-23T09:37:32Z by Yevo
  • oeakdemir
    oeakdemir
    144 Posts

    Re: expanded command line too long

    ‏2012-02-19T00:25:18Z  
    I was told that I can get nmake to write the command line arguments to a file, then use the link option to read the arguments from the file.

    Some more info is said to be given here about "inline files":
    http://msdn.microsoft.com/en-us/library/z440c98k(v=vs.80).aspx

    However, I can not still see how I can create an inline file and then use it, within Rhapsody.
    any help ?
  • Yevo
    Yevo
    280 Posts

    Re: expanded command line too long

    ‏2012-02-19T08:23:50Z  
    • oeakdemir
    • ‏2012-02-19T00:25:18Z
    I was told that I can get nmake to write the command line arguments to a file, then use the link option to read the arguments from the file.

    Some more info is said to be given here about "inline files":
    http://msdn.microsoft.com/en-us/library/z440c98k(v=vs.80).aspx

    However, I can not still see how I can create an inline file and then use it, within Rhapsody.
    any help ?
    Try to change MakeFileContent property as the following:

    $(TARGET_NAME)$(EXE_EXT): $(OBJS) $(ADDITIONAL_OBJS) $(TARGET_MAIN)$(OBJ_EXT) DefaultComponent.mak
    @echo Linking $(TARGET_NAME)$(EXE_EXT)
    @echo $(OBJS) > objs.list
    $(LINK_CMD) $(TARGET_MAIN)$(OBJ_EXT) @objs.list $(ADDITIONAL_OBJS) \
  • oeakdemir
    oeakdemir
    144 Posts

    Re: expanded command line too long

    ‏2012-02-22T10:51:03Z  
    • Yevo
    • ‏2012-02-19T08:23:50Z
    Try to change MakeFileContent property as the following:

    $(TARGET_NAME)$(EXE_EXT): $(OBJS) $(ADDITIONAL_OBJS) $(TARGET_MAIN)$(OBJ_EXT) DefaultComponent.mak
    @echo Linking $(TARGET_NAME)$(EXE_EXT)
    @echo $(OBJS) > objs.list
    $(LINK_CMD) $(TARGET_MAIN)$(OBJ_EXT) @objs.list $(ADDITIONAL_OBJS) \
    it does not work neither.
  • Yevo
    Yevo
    280 Posts

    Re: expanded command line too long

    ‏2012-02-22T13:22:37Z  
    • oeakdemir
    • ‏2012-02-22T10:51:03Z
    it does not work neither.
    Try to create library including all these objects and then take it instead.
    Something like:
    $(TARGET_NAME)$(EXE_EXT): $(OBJS) $(ADDITIONAL_OBJS) $(TARGET_MAIN)$(OBJ_EXT) DefaultComponent.mak
    @echo Linking $(TARGET_NAME)$(EXE_EXT)
    $(LIB_CMD) $(LIB_FLAGS) /out:objs$(LIB_EXT) $(OBJS)
    $(LINK_CMD) $(TARGET_MAIN)$(OBJ_EXT) objs$(LIB_EXT) $(ADDITIONAL_OBJS) \
  • oeakdemir
    oeakdemir
    144 Posts

    Re: expanded command line too long

    ‏2012-02-23T09:23:22Z  
    • Yevo
    • ‏2012-02-22T13:22:37Z
    Try to create library including all these objects and then take it instead.
    Something like:
    $(TARGET_NAME)$(EXE_EXT): $(OBJS) $(ADDITIONAL_OBJS) $(TARGET_MAIN)$(OBJ_EXT) DefaultComponent.mak
    @echo Linking $(TARGET_NAME)$(EXE_EXT)
    $(LIB_CMD) $(LIB_FLAGS) /out:objs$(LIB_EXT) $(OBJS)
    $(LINK_CMD) $(TARGET_MAIN)$(OBJ_EXT) objs$(LIB_EXT) $(ADDITIONAL_OBJS) \
    hi,

    i still get the same "command line too long" error.

    in addition to that, some obj files lead to warnings saying that

    "warning LNK4221: no public symbols found; archive member will be inaccessible"

    any other way ?
  • Yevo
    Yevo
    280 Posts

    Re: expanded command line too long

    ‏2012-02-23T09:37:32Z  
    • oeakdemir
    • ‏2012-02-23T09:23:22Z
    hi,

    i still get the same "command line too long" error.

    in addition to that, some obj files lead to warnings saying that

    "warning LNK4221: no public symbols found; archive member will be inaccessible"

    any other way ?
    I think, this error belongs to LIB_CMD, while warning means the library was not created or created empty.

    You canadd -n option into Share\etc\msmake.bat (or msvc9make.bat - depending on environment you use) and run make again. This option forces make to print compilation/link commands without executing them. Where do you indeed see this "too long" line?

    If it belongs to LIB_CMD, then you can modify it using wildcard instead of list of objects:
    $(LIB_CMD) $(LIB_FLAGS) /out:objs$(LIB_EXT) *.obj

    Of course, this method has limitations. If some of objects in $(OBJ) include paths, you should take into account.