User forums > Using Code::Blocks

building a static lib: problems with ar

(1/2) > >>

leumi:
hello.

i am new to C::B.

i tried to build a simple static library with code::blocks. the code is written in d-language, but this shouldn't make any difference, because the problem affects the object file "testlib.o".

when the code is compiled C::B uses "ar" to build the final file "libtestlib.a"
but, somehow C::B uses the command "ar" in the wrong way: i get the following error-message:

Compiling: testlib.d
Linking static library: libTestlib.a
ar: illegal option -- T
Usage: ar [emulation options] [-]{dmpqrstx}[abcfilNoPsSuvV] [member-name] [count] archive-file file...
       ar -M [<mri-script]
 commands:
  d            - delete file(s) from the archive
  m[ab]        - move file(s) in the archive
  p            - print file(s) found in the archive
  q[f]         - quick append file(s) to the archive
  r[ab][f]  - replace existing or insert new file(s) into the archive
  t            - display contents of archive
  x[o]         - extract file(s) from the archive
 command specific modifiers:
  [a]          - put file(s) after [member-name]
            - put file(s) before [member-name] (same as )
  [N]          - use instance [count] of name
  [f]          - truncate inserted file names
  [P]          - use full path names when matching
  [o]          - preserve original dates
            - only replace files that are newer than current archive contents
 generic modifiers:
  [c]          - do not warn if the library had to be created
            - create an archive index (cf. ranlib)
            - do not build a symbol table
  [v]          - be verbose
  [V]          - display the version number
  @<file>      - read options from <file>
 emulation options:
  No emulation specific options
ar: supported targets: elf32-i386 a.out-i386-linux efi-app-ia32 elf32-little elf32-big elf64-x86-64 elf64-little elf64-big srec symbolsrec tekhex binary ihex trad-core


why does c::b use the option "--T"? the command ar doesen't have this option.
whatcan i do to get my static library work?

i'd be very thankfull for any help!


ps: the source code: "libtest.d" (it's very smal. just for testing)

module testlib;
import std.stdio;

void add(int i1, int i2)
{
   writefln("Greetings from your lib:",i1 + i2,"\n");
   return 0;
}

stahta01:
Please cleanup the post so it is readable.

Please turn on Full Command Line Logging and post the command causing the error.

Steps to turn on Compiler Logging in Nightly Build:
"Settings" -> "compiler debugger"
Change "Compiler Settings" to "Other Settings"
Set "Compiler Logging" to "Full Command Line"

Tim S

leumi:
ok. thank you.

the following command causes the error:

ar libTestlib.a  obj/Release/testlib.o


it results in this error message:

ar: illegal option -- T
Usage: ar [emulation options] [ - ]{dmpqrstx}[ abcfilNoPsSuvV ] [ member-name ] [ count ] archive-file file...
       ar -M [ <mri-script ]
 commands:
  d            - delete file(s) from the archive
  m[ ab ]        - move file(s) in the archive
  p            - print file(s) found in the archive
        .
        .
        .
ar: supported targets: elf32-i386 a.out-i386-linux efi-app-ia32 elf32-little elf32-big elf64-x86-64 elf64-little elf64-big srec symbolsrec tekhex binary ihex trad-core
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings



i don't understand this error message. the option " -- T " is not used by c::b


i hope someone can help me.

stahta01:
Try running the "bad command" in an cmd window and see if you get the error there.

Also, try do the following command and post results.

--- Code: ---ar --version

--- End code ---
Tim S

rcoll:
Is there a space character between the "lib" and the "Testlib.a" part of that filename?


--- Quote from: leumi on May 22, 2007, 07:50:21 pm ---the following command causes the error:

ar libTestlib.a  obj/Release/testlib.o

--- End quote ---

-- Ringo

Navigation

[0] Message Index

[#] Next page

Go to full version