0

Im trying to compile static library project with CodeLite and getting error:

ar rcus ./Debug/libtestlib.a @"testlib.txt" 
ar: @testlib.txt: No such file or directory

But i have file testlib.txt. When i inspect exported makefile i see:

$(AR) $(ArchiveOutputSwitch)$(OutputFile) @$(ObjectsFileList) $(ArLibs)

For me it is strange to see there @ symbol near ObjectsFileList. How should i compile static library project in CodeLite ?

Holinov Ilya
  • 33
  • 1
  • 6

1 Answers1

4

The @"testlib.txt" is a way of letting the linker (or ar in your case) to read the object list from a file and not from a command line, this is done because on some OS, there is a limitation on the input string that a program can accept from the command line.

Usually this is not a problem ( you did not mention what is your OS and CodeLite version ) but if it is a problem (like in your case), you can disable this from CodeLite's menu bar:

Settings -> Build Settings -> Compilers -> <Your Compiler Name> -> Advanced

and Uncheck the option: "Pass object list to the linker via file" and your problems will be gone

FYI: I only seen this error on OSX, is this the case here?

Eran

Eran
  • 2,310
  • 1
  • 13
  • 13
  • Yes i'm having this trouble on OSX. I'll try this solution next time i'm able to get to my Mac – Holinov Ilya May 28 '14 at 17:34
  • I have this problem on OSX. It seems the *.txt file required is created but not where the linker is looking for it (?). Changing the setting as you described did fix the problem. +1, thank you. – Matthew James Briggs Mar 02 '15 at 04:27