Command-line to combine obj files (.o) into a Static Library (lib.a) file.

I have a library that I need to compile for Solaris 10 x86 using Sun Studio. I compile the source files to make obj files by issuing the command:
Bash-3.0# cc -c -D"_UNIX_" *.c
This compiles every source.c and produces an object.o file. (Nice, & simple.)
Now, what is the command-line to combine all those object.o files (along with a few other staticlibs.a) and make one archive, lib.a?
I've done this many times with the gnu - gcc compilers. Is it possible with the Sun Studio Tools? And where is it documented?
I thought I had this 'licked' when installed SS12u1 and built the 'Welcome' project. But I have searched the "Sun Studio 12: C User's Guide" from top to bottom, and I don't have a 'clue' :-( ...
Mike <><><>

Run the command
man arto get the details of using ar.
If you create an archive library newly each time (instead of trying to update an existing library), this command will do the job:
ar -r myarchive.a file1.o file2.o file3.o ... I recommend building the archive freshly each time instead of trying to update an existing archive. You can get unpleasant surprises when trying to update.
To link an archive into a program, just put the archive name on the linking command line (with a -L option to point to the directory if appropriate). The position of the archive on the command line matters. The linker scans the archive as it processes command-line options in order. It pulls a .o from the archive only if it has already seen a reference to a symbol that is defined in the archive. Therefore, the archive must follow all files and other libraries that reference the contents of the archive. Example:
Suppose f1.o uses something from archive.a, and all files are in the same directrory. This command will work:
cc -o myprog main.o f1.o archive.a This command will not work:
cc -o myprog main.o archive.a f1.o The reference in f1.o will not be satisfied.

Similar Messages

  • Convert file format into UTF-8 while generating text file on FTP server

    Hi Expert,
    I have the requirement to generate text file store it in FTP server and file format should be in UTF-8.
    ABAP Development is completed but text file format generate in ANSI which not acceptable by client.For generating text file and store it on FTP server by using standard function module FTP_R3_TO_SERVER ,but in this function module there is no any parameter option like CODEPAGE for file format conversion. Is there any method or any function module to convert file format to UTF-8 and directly transfer or store it on FTP server.
    <<removed_by_moderator>>
    Thanks ,
    Edited by: Vijay Babu Dudla on Jan 28, 2009 12:48 AM

    I have come across the same issue.  Try calling the FTP_COMMAND function module to make it go into ASCII mode before your FTP the file, like this:
    data: result type table of text with header line.
    call function 'FTP_COMMAND'
        exporting
          handle        = hdl
          command       = 'ascii'
        tables
          data          = result
        exceptions
          tcpip_error   = 1
          command_error = 2
          data_error    = 3.
      call function 'FTP_R3_TO_SERVER'
        exporting
          handle         = hdl
          fname          = docid
          character_mode = 'X'
        tables
          text           = gt_your_table .

  • How do I combine separate user libraries into one public library

    In Windows Vista, most of the iTunes files (musing & movies) are in the public folder. But, my kids have files in their separate user folders.
    My question is how do I copy the files from the separate user folders to the public folder so that any of them can load any of the files into their iPods?
    Thanks in advance for the help.

    Drag one account's home folder from the Users folder to the other account's desktop, provide your administrator password, and then move your files from it.
    (75344)

  • How can I move the music files back into my itunes library?

    Hi. I hope you can help. We bought a new computer and I was using my iPod as an external drive to move the music from one to another. This did not work, it said it ran out of room even though there was room on it...Anyway when i returned to my iTunes page the music was no longer in the library. When i check the files on my computer it is still there, yet it is not in the library. How can I get it back there? Whenever I plug in my iPod now it tries to sync it with the library which would wipe away all of the music.
    Thanks

    +"When i check the files on my computer it is still there, yet it is not in the library."+
    Putting the files on your computer does not cause them to be added to the library. To add them, use the command File > Add Folder to Library, and point it to My Music or whatever folder(s) all the music is in.

  • Saving PSE-edited RAW files directly into my iPhoto library in JPEG format

    I take photos in RAW format and like to save the edited file in iPhoto in JPEG. I'm using a pretty convoluted process--changing the PSD extension to JPG and saving to my desktop. Then dragging the file from desktop to iPhoto in the dock. The file is then in its own event, and I can move it where I want it. Can the file be saved directly to the event in iPhoto from PSE? Thanks.
    John Willetts

    John
    No. What you are doing is the "correct" way to do things.
    The problem arises because when you process the RAW it's saved as a different format, hence a new file and that has to be imported independently.
    Regards
    TD

  • Problems loading nib files after class is split into a static library.

    I've recently split a project so that the common re-usable controls are in their own class library. My original application project now references these using a cross project reference.
    However, since I have split the projects up, my original project crashes when it loads main.xib because it cannot find one of the custom classes which is defined in the library project.
    When I first split up the projects, I noticed that there were problems with the nib files not being able to find the IB outlets of the custom classes, but I managed to get around these by going importing the relevant library class files manually (File > Read Class Files…).
    I have made sure that all of the nib files compile without warning, so as far as I can tell, Interface Builder is able to read the necessary class headers, but when I try to run the app, it crashes saying that there is an unknown class in the Interface Builder file and that the class is not coding compliant.
    Are there any steps I've missed or advice on how to troubleshoot this?

    I did a bit of digging. The reason why this wasn't working is because the class in question was referenced by the nib files, but not in code. Therefore, while the code compiled and there were no warnings with the nib files, the linker was not linking the classes because no code used them directly.
    This can be fixed by going to the Project Settings, and on the Build tab, underneath the Linking heading, adding -ObjC to the Other Linker Flags section.

  • How can I open a PDF file and enter a word in the Find field from the command line?

    Hi,
    I want to use a PDF file as the help file of another program.
    I have found somewhere an incomplete description of the command line parameters of Acrobat Reader.
    It described how to open a file and jump to its given page.
    I have written the following batch file based on that.
    rem Open pdf (prm1) with Acrobat reader at given page (prm2)
    "%adobe_rdr%\AcroRd32.exe" /N "zoom=73&page=%2=OpenActions" %1
    The following batch file opens the search dialog:
    rem Open pdf (prm1) with Acrobat reader
    rem and search for something (prm2)
    "%adobe_rdr%\AcroRd32.exe" /N "zoom=73&navpanes=1=OpenActions&search=%2" %1
    I need the simple find field instead of the complicated search window.
    Regards
                   Ferenc

    Not possible.

  • Command-line -t frameRange wildcard for all frames?

    Greetings,
    Pretty new to Shake and I am trying to get a seemingly simple command-line workflow going. I have a patch of QT files I need to output as DPXs after being deinterlaced. Where I am getting hung up is with the frameRange. It seems it will only render the first frame unless I give a range. Since I don't know how many frames each individual MOV has, I am getting stumpped. Is there a wildcard or some other option for having shake just do the whole thing?
    Here's my command-line:
    *shake -v -fi 0003PU.mov -deinterlace 0 1 -fo 0003PU_DPX/0003PU.#.dpx*
    I have >80 QT files to convert to DPX, it seems a waste of time to have to open each one in the Shake GUI to find out the total frame count for each one. In the GUI it has the "Auto" button which populates the timeRange field with the full range, surely there must be something I can do from the command-line!

    I wish there were such a wildcard! That would make life so easy.
    I did figure out a way to generate Shake scripts automatically,
    including finding the length of the source file. It will take a little
    work: you'll have to learn bash.
    Basically bash is a way of taking a bunch of command lines,
    and combining them into something you can run as a program.
    Here are two excellent resources for learning:
    http://www.ibm.com/developerworks/library/l-bash.html
    http://www.grymoire.com/Unix/
    These two sites are awesome.
    __________EXAMPLE ONE
    Every bash script includes this line:
    #!/bin/sh
    Then you just start adding UNIX and/or bash commands.
    So copy these two lines into a plain text editor window
    and save them as amnesia.sh
    #!/bin/sh
    whoami
    In Terminal you can run your new program!
    Use cd to navigate to where amnesia.sh is,
    and type
    bash amnesia.sh
    You will be reminded of your identity.
    __________EXAMPLE TWO
    Jumping ahead really quickly, here's a technique for
    making a loop that will call up the name of
    every Quicktime movie in a folder and send
    it to some function in your bash script:
    cd ./folder_containing_movies
    for i in $(find . -name '*.mov');
    do
    my_fi=`basename $i`
    my_function $my_fi
    done
    __________EXAMPLE THREE
    Now we'll define that function: it prints out the name of the movie.
    This part of the script must be above the loop
    from which it is called.
    So here's the complete bash script:
    #!/bin/sh
    my_function ( )
    echo $my_fi
    cd ./folder_containing_movies
    for i in $(find . -name '*.mov');
    do
    my_fi=`basename $i`
    my_function $my_fi
    done
    __________EXAMPLE FOUR
    In order to have shake do something with these movies,
    you could, in the example above, replace
    echo $my_fi
    with
    shake $my_fi
    but then you'd just get the first frame, and you'd
    have to quit each Viewer to see the next movie.
    For normal fully-tweaked dozens-of-nodes Shaking, one would use
    shake -exec my_script.shk
    The problem is that it's difficult (impossible?) to pass variables
    like my_fi into my_script.shk. I was unable to do it--
    probably because I'm just a beginner--
    so I used bash to replace key words in a template,
    scriptTemplate.shk, to write one shake script for each movie.
    To do this, you need to replace parameters in the Shake script
    with words that can be searched and replaced. In your Shake
    template, the FileIn filename can be something like SEDmy_fi.
    In bash you can use the sed command to search and replace
    the expressions in the template:
    sed -e 's/SEDmy_fi/'$my_fi'/g' scriptTemplate.shk > ./scripts_out/${my_fo}.shk
    This does the search and replace, then writes a shake script
    named automatically by my_fo, another variable you've created:
    my_fo=`echo $my_fi | sed 's/.mov/_output/'`
    __________EXAMPLE FIVE
    At this point your head is totally spinning. Don't worry.
    This is not a tutorial; I'm just trying to sketch out
    the broad ideas here. You'll still have to learn bash
    for this to make sense.
    As a special bonus, here's a really useful bash command I stole from Olli
    at vfxtalk.com to get the timerange of a movie using shake -info :
    timerange=`shake ./folder_containing_movies/$my_fi -info 2>&1 | grep Duration | sed 's/info: Duration: //'`
    You could then use $timerange elsewhere in your bash script.
    Hope that helps,
    Les

  • Final Cut Export XML: Command-line option

    Is there a way to use a command-line function to automatically export the XML for a Final Cut (.fcp) file ? We need to see the clips that make up a .fcp file, and do reporting. Since we have thousands of these files, we need to automatically create the XML files without opening each file automatically.

    Hey Ani_,
    I've been working with Adobe products for a long time and typically when you come across an error that has anything to do with a XML file export problem its due to things such as effects you may have added in, color corrections, cross fades or any type of video transitions between clips. Remember your work flow should be
    Import your footage into Premiere Pro
    Name your clips (helps find things later on)
    Place clips on time line in the order you wish (ONLY MAKE CUTS don't add anything, transitions color effects nothing)
    Then once your clips are all placed on the timeline in your correct order you then EXPORT> Final Cut Pro XML
    Now you can bring this into other programs for color grading or whatever else your going to do.  You will notice you have no errors on the export.
    Once your done doing what your doing to the clips in another program (for example: Divinci Resolve color grading) you can then export them back to your main project then add your effects and transitions.

  • Running powewrpc programs from the command line

    I am trying to run a powerpc application (quicken) from the command line. I want to log into the mac over my local network and run a powerpc program, but I get the following when I try it:
    cannot execute binary file
    I am logging in via ssh, and am running the X11 package from a different unix system which also runs X11.
    How do I get the application to execute? (it runs fine from the desktop).

    I am sitting at a Sun Solaris machine (it runs X11R6
    and Matif). I want to run Quicken, which is on the
    mac mini. I log into the mac with ssh -X. I find the
    Quicken program, but the permissions are set to 644
    (read, but not execute). If I change the permissions
    and try to run the program I get teh error message
    "cannot execute binary file".
    The window interface of the Mac is not X11: so you cannot output it on another X system. Is is not like connecting to another Un*x system.
    Said that, you should be able to launch a program, but you cannot see the output. However, usually Macosx applications are bundles with some executable inside, not directly an executable file: .app files are folders, not files. In order to launch such kind of apps, you have to use the open command I suggested in the previous post.
    I have no idea what VNC is. If this is how I can do
    this, then please provide me a link to it.
    VNC is a screen sharing application, just like Windows Remote Desktop. You may install a VNC server on your mac mini, and then connecting with a VNC client you will see all your computer screen as if you were there. It is cross platform, so no matter which is your client (including mobile phones).

  • Useing command line to send test sms to emulator

    The WMA console tool packaged with the WTK is great, but the test messages I need to send are compllicated enough that I would prefer not to have to type them in every time I need to exercise the sequence. Is there a way to use the command line on utils to send a binary message from a source text file to my app running on the emulator? What I really want to do is build it into an ant task...

    OK, well, consider this a feature request...

  • Testing Java Concurrent Program on the command line in Windows

    I'm using the suggestions in:
    http://blogs.oracle.com/xmlpublisher/2007/05/02
    to test my Java concurrent program on the command line. Our production environment is running on Unix. I've been able to test it successfully on the Unix environment from the command line. However, it fails when I try to test it on the Windows command line with the following stack trace:
    Exception in static block of jtf.cache.CacheManager. Stack trace is: oracle.apps
    .jtf.base.resources.FrameworkException: IAS Cache initialization failed
    at oracle.apps.jtf.cache.IASCacheProvider.init(IASCacheProvider.java:225
    at oracle.apps.jtf.cache.CacheManager.activateCache(CacheManager.java:14
    44)
    at oracle.apps.jtf.cache.CacheManager.initCache(CacheManager.java:752)
    at oracle.apps.jtf.cache.CacheManager.<clinit>(CacheManager.java:378)
    at oracle.apps.fnd.cache.Cache.setCacheFullName(Cache.java:228)
    at oracle.apps.fnd.cache.Cache.initCache(Cache.java:114)
    at oracle.apps.fnd.cache.Cache.<init>(Cache.java:89)
    at oracle.apps.fnd.cache.AppsCache.<init>(AppsCache.java:86)
    at oracle.apps.fnd.cache.AolCaches.getCache(AolCaches.java:155)
    at oracle.apps.fnd.profiles.Profiles.<clinit>(Profiles.java:241)
    at oracle.apps.fnd.profiles.ExtendedProfileStore.init(ExtendedProfileSto
    re.java:498)
    at oracle.apps.fnd.profiles.ExtendedProfileStore.<init>(ExtendedProfileS
    tore.java:119)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
    orAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
    onstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
    at oracle.apps.fnd.common.AppsContext.instantiateProfileStore(AppsContex
    t.java:4312)
    at oracle.apps.fnd.common.AppsContext.makeProfileStore(AppsContext.java:
    1171)
    at oracle.apps.fnd.common.Context.setProfileStore(Context.java:970)
    at oracle.apps.fnd.common.Context.setProfileStore(Context.java:952)
    at oracle.apps.fnd.common.AppsContext.initializeContext(AppsContext.java
    :958)
    at oracle.apps.fnd.common.AppsContext.initializeContext(AppsContext.java
    :918)
    at oracle.apps.fnd.common.AppsContext.<init>(AppsContext.java:752)
    at oracle.apps.fnd.cp.request.CpContext.<init>(CpContext.java:141)
    at oracle.apps.fnd.cp.request.CpContext.<init>(CpContext.java:124)
    at oracle.apps.fnd.cp.request.Run.main(Run.java:127)
    Caused by: oracle.apps.jtf.base.resources.FrameworkException: null
    null
    CacheDefaultConfig.properties (The system cannot find the file specified)
    at oracle.apps.jtf.base.resources.FrameworkException.convertException(Fr
    ameworkException.java:607)
    at oracle.apps.jtf.base.resources.FrameworkException.addException(Framew
    orkException.java:585)
    at oracle.apps.jtf.base.resources.FrameworkException.<init>(FrameworkExc
    eption.java:66)
    at oracle.apps.jtf.base.resources.FrameworkException.<init>(FrameworkExc
    eption.java:88)
    at oracle.apps.jtf.base.resources.FrameworkException.<init>(FrameworkExc
    eption.java:202)
    at oracle.apps.jtf.base.resources.FrameworkException.<init>(FrameworkExc
    eption.java:218)
    at oracle.apps.jtf.base.resources.FrameworkException.<init>(FrameworkExc
    eption.java:249)
    ... 26 more
    Exception in thread "main" oracle.adf.mds.exception.MDSRuntimeException: Cache n
    ot initialized
    at oracle.apps.fnd.framework.mds.cache.ATGCacheMgrDelegateImpl.<init>(AT
    GCacheMgrDelegateImpl.java:325)
    at oracle.apps.fnd.framework.mds.cache.ATGCacheFactoryImpl.<init>(ATGCac
    heFactoryImpl.java:44)
    at oracle.apps.fnd.cp.request.CpContext.getMDSContext(CpContext.java:116
    9)
    at oracle.apps.fnd.cp.request.Run.main(Run.java:130)
    I've put the appsborg2.zip file in my classpath. I've also copied the entire (1 GB) worth of Java .class files for Oracle apps onto my computer and placed it on my classpath. Is there something that prevents me from testing out my Java concurrent program on my Windows machine from the command line?

    i think if u run the ap in the command line then it has to stay open, you could try writing a .bat file then when that is executed it will only open the command line for the program execution (i think)

  • Sun Web Server 6 to 7 Command Line Migration - Syntax Question

    I have used the GUI-based migration tool in a development environment and it works flawlessly. However, in prod environments I cannot use the GUI as a matter of policy. In reading the 6x to 7x migration guide, the following example is included for command-line based migrations:
    wadm> migrate-server [--user=admin-user] [--passwordfile=*admin-pswd-file*][--host=admin-host][--port=admin-port][--no-ssl][--rcfile=*rcfile*][--echo][--no-prompt][--verbose][--search-collection-copy-path=directory][--log-dir=directory]([--all|[--config=newconfigname[--instance=instancename]) --server-root=path
    In looking at my 6 and 7 web server instances, I cannot locate a password file or the rcfile. Is the password file optional? Do you have to create one or does the server generate this for you? Also, what is the rcfile and where would I find it?
    Thanks!

    As a rule, any option mentioned b/w [ and ] is optional.
    Both password-file and rcfile are provided to avoid any prompts by the CLI.
    For example if the password-file is provided (with the passwords) then the CLI will not prompt for the passwords. If not, the CLI will prompt for passwords.
    In the rcfile you may set variables for path to the password file, user name, standard option values like config name, vs name, etc.
    Find more details in http://blogs.sun.com/yamini/entry/starting_off_with_web_server.
    For more details on the individual commands check out http://docs.sun.com/app/docs/doc/820-2204/6ndqrqrou?l=en&a=view

  • How to Create Test Sequence Document in HTML using command line

    How to Create Test Sequence Document  in HTML using command line
    I have lot of sequences and I want to create Test Sequence Documentation in HTML format using Command Line automatically, is there a way to automate this task using .bat file or using   C#  .Net

    If you aren't able to figure out how to call a C++ DLL in .net then there may be another option.  Unfortunately I don't know how to do this off the top of my head and I don't have an example.
    The other option would be to change docgen.seq a little bit to the dialog doesn't display and you just hardcode the options.  Then you can use a command line to call testexec.exe: http://zone.ni.com/reference/en-XX/help/370052K-01/tsfundamentals/infotopics/startup_opt/
    Hope this helps,
    jigg
    CTA, CLA
    teststandhelp.com
    ~Will work for kudos and/or BBQ~

  • Command Line Build Option

    Hello All--
    Is there any way I can invoke jdev.exe from the command line with an option to specify that it build my .jpr project file, and without invoking the IDE or requiring any other interaction? I'm new to JDeveloper, and I got used to this nicety over many years of using the -build option of JBuilder (which is now WAY too pricey for my needs). BTW, I know I can use an Ant configuration file, and that is specifically what I am trying to now move away from, and keep things as simple and streamlined as possible.
    If there is currently no way to do this, I'd like to add this to the feature request list. Maybe the developers could squeeze that in before final rollout :)
    Thanks.

    If this is a requirement what is wrong with using Ant? You can generate the Build.xml from the project by using New > Ant > BuildFile from Project so you don't have the pain of maintaining the basic script. Likewise you can use Ant as your build-system in the product as well if you only want to use one method. I find useful for making and testing all in one go.
    Anyway in answer to your question no - to see the command line options to the IDE type jdev -help from the command prompt.

Maybe you are looking for

  • Can I still use the Optical Drive if I install a SSD in my MacBook Pro?

    Hello, I'm looking to replace the standard hard drive in my MacBook Pro with a 240GB SSD, my question is, does this effect the usage of the DVD/CD Drive? As i've seen in some videos people taking that out and putting the exsisting hard drive there. I

  • Issues with nested for loops - saving images from a camera

    Hi all, I've written a vi. to capture a specific number of images ('Image No') and save these images, outputted to a folder of my choice.  Each image is identified sequentially.  However, I wish to do a number of iterations ('Run') of this capture se

  • ML up-to-date claim nightmare

    I wanted to share with you guys my frustration and sheer displeasure with the ML up-to date program and the terrible experience I've had in dealing with Apple. On June 16th 2012 I paid for a 13" MPB from Best Buy using the the store pickup option fro

  • My music video looks like ****

    hello...i've made a couple of music videos, and the latest one i did on Final Cut Pro HD, and it looks great..when viewed on my Imac screen.. when i burned it to dvd and stuck it on the TV however, it looked like ****. bleedy colours, dodgy frame rat

  • Nokia N97 Mini - Pictures / Video - Disable

    Hey, I recently got my Nokia N97 Mini, And im just wondering if its possible to disable the Camera Shutter noise whenever your taking a picture, And is it possible to turn off the Red Light when recording?  Its annoying when im trying to record somet