Creating simple shared library using gcc under Solaris 10

Hi All:
I apologize if this is too newbie a question but have seen nothing that works for me yet.
I'm trying to create a shared library that contains a single object file using gcc (as installed on Solaris 10). I compiled the source code as follows:
gcc -c -fPIC x.cpp -o x.o
and got the x.o object file created and readable.
I then tried (from sample code on line):
gcc -shared -Wl,-soname,libMyLib.so.1 -o libMyLib.so.1.0.1 x.o
and get the following errors:
ld: warning: option -o appears more than once, first setting taken
ld: fatal: file libMyLib.so.1: open failed: No such file or directory
ld: fatal: File processing errors. No output written to x.o
collect2: ld returned 1 exit status

-soname is a GNU ld option. Use -h instead.
NB:
- you should use g++ not gcc to compile C++ code
- this forum is about the Oracle C++ compiler, not gcc. With it, you would do:
CC -c -KPIC x.cpp
CC -G -h libMyLib.so.1 -o libMyLib.so.1.0.1 x.o

Similar Messages

  • Creating a shared library for JNI in windows

    I went through the JNi tutorial online and it worked just fine on a Linux computer. Now I'm trying to make do the same tutorial on windows. When I get to the step 4. Create a Shared Library, I'm stuck. I don't know how to create this shared library on windows. It gives an example using Visual C++ but I don't have that. Any tips or advice out there what I should do? Any help would be greatly appreciated.

    //mac.java
    class mac
        public native void getMac();
        private native String getLine(String prompt);
        static {
         System.loadLibrary("myMac");//This is myMac.DLL
         /*if generated by borland
         System.loadLibrary("mymac");//This is mymac.dll
         public static void main(String[] args)
        mac mc=new mac();
        String input = mc.getLine("Enter Some Thing ");
        System.out.println("You Entered " + input);
        System.out.println(mc.getMac());
    prompt> javac mac.java
    prompt> javah -jni mac
    Borland compiler
    /*mymac.c*/
    #include <jni.h>
    #include "mac.h"
    #include <stdio.h>
    JNIEXPORT void JNICALL
    Java_mac_getMac(JNIEnv *env, jobject obj)
        printf("I am in  getmac dir in mymac.dll (Borland) \n");
        return;
    JNIEXPORT jstring JNICALL
    Java_mac_getLine(JNIEnv *env, jobject obj, jstring enter)
        char buf[128];
        const char *str = (*env)->GetStringUTFChars(env, enter, 0);
        printf("%s", str);
        (*env)->ReleaseStringUTFChars(env, enter, str);
        scanf("%s", buf);
        return (*env)->NewStringUTF(env, buf);
    To generate DLL
    create bcc32.cfg file in %BORLAND_INSTALL%/BCC5/bin Folder
    In the bcc32.cfg file add following code
    -I"%BORLAND_INSTALL%\BCC55\include;%JAVA_HOME%\include;%JAVA_HOME%\include\win32"
    -L"%BORLAND_INSTALL%\BCC55\lib;%BORLAND_INSTALL%\BCC55\Lib\PSDK;"
    i.e the path for borland compiler and java.
    now goto prompt and say
    prompt>bcc32 -tWM -tWD mymac.c
    This will create mymac.lib File
    Now say
    prompt>implib -c mymac.lib mymac.dll
    That's it!!
    there you are with dll
    Now you can run the mac.class file by using java
    VC++
    Click File->New->Win32Dynamic-Link Library
    Give name and Select
    A simple DLL project
    You will have
    myMac.CPP file
    // myMac.cpp : Defines the entry point for the DLL application.
    #include "stdafx.h"
    #include "mac.h"
    #include "jni.h" //can copy or give full path
    #include <math.h>
    BOOL APIENTRY DllMain( HANDLE hModule,
                           DWORD  ul_reason_for_call,
                           LPVOID lpReserved
        return TRUE;
    JNIEXPORT void JNICALL
    Java_mac_getMac(JNIEnv *env, jobject obj)
        printf("You are in getMac (VC++) DLL\n");
    JNIEXPORT jstring JNICALL
    Java_mac_getLine(JNIEnv *env, jobject obj, jstring enter)
        char buf[128];
        const char *str = env->GetStringUTFChars(enter, 0);
        printf("\n%s", str);
        env->ReleaseStringUTFChars(enter, str);
        scanf("%s", buf);
        return env->NewStringUTF(buf);
    Hope this is useful
    regards
    kanad Deshpande

  • Exceptions not caught in shared library when compiled under Sun Studio 9

    I realize it's a fairly old version of Sun Studio, however if at all possibly we'd like to avoid updating to the latest.
    Sun Studio 9, version reports
    version of "/opt/SUNWspro/bin/../prod/bin/../../bin/cc": Sun C 5.6 2004/07/15
    version of "/opt/SUNWspro/bin/../prod/bin/../../bin/CC": Sun C++ 5.6 2004/07/15
    uname -a
    SunOS sunblade 5.9 Generic_118558-27 sun4u sparc SUNW,Sun-Blade-100
    The problem is within our shared library a function calls another method within a try/catch block. This method then sometimes throws an exception which does have a matching catch block. On all other systems (Windows, AIX, HP-UX, Linux) the code works, the exception is caught and handled. On Solaris with Sun Studio 9 though, the exception is ignored and instead triggers an abort and core dump.
    Stack Trace:
    ffffffff7daa871c lwpkill (6, 0, ffffffff7fffd9c0, ffffffff7d3064d4, 2, ffffffff7fffd9ec) + 8
    ffffffff7da3e4b8 abort (ffffffff7d40dac8, ffffffff7d40cc38, ffffffff7d411e78, 10604c, 2, ffffffff7d40dac8) + 100
    ffffffff7d3064d4 __1cH__CimplRdefault_terminate6F_v_ (ffffffff7d40dac8, ffffffff7d40cc38, ffffffff7d411e78, 10604c, 104e40, ffffffff7d3064d0) + 4
    ffffffff7d3062b4 __1cH__CimplMex_terminate6F_v_ (ffffffff7d40de40, 0, 0, ffffffff7d40de40, ffffffff7d40c978, 1) + 24
    ffffffff7d306f04 exthrow_body (ffffffff7d40de40, 0, 0, 105af4, 52, ffffffff7d40e2e8) + 84
    ffffffff7d306e58 __1cG__CrunIex_throw6Fpvpkn0AQstatic_type_info_pF1_v_v_ (ffffffff7d40dec8, ffffffff7f0dea78, ffffffff7ecb6b28, ffffffff7d40de40, 0, ffffffff7d40de40) + 3c
    ffffffff7ecb6d90 __1cLIGExceptionFThrow6FnQenumIGErrorCodes_pkcxxp2x_v_ (fffffffffffff3e3, 0, 0, 0, ffffffff7f1187da, a0) + 80
    ffffffff7ecb6e78 __1cOThrowException6FnQenumIGErrorCodes_pkcxxp1x_v_ (fffffffffffff3e3, 0, 0, 0, ffffffff7f1187da, a0) + 30
    ffffffff7f083304 __1cSIGRasterProcessingNVerifyPalette6FpnMIGRasterPage_nTenumIGContrastModes__v_ (1001f3c10, 0, 0, 0, 0, 0) + b4
    ffffffff7f083760 __1cSIGRasterProcessingOInvertContrast6FpnMIGRasterPage_nTenumIGContrastModes_nTenumIGColorChannels_pnPtagAT_RECTANGLE__v_ (1001f3c10, 0, 0, ffffffff7fffe1a8, 0, 0) + 20
    ffffffff7f039a2c iIG_IP_contrast_invert (1001f3c10, 100162b10, 0, 0, 0, 0) + 104
    ffffffff7f039ba0 iIG_IP_contrast_invert_masked (1001f3c10, 100162b10, 0, 0, 0, 0) + 80
    000000010000b4e0 ipcontrast_invert_notify (10014d000, 10014d, 0, 100000, 100162000, 100162) + 48
    Try/catch block:
         try
              <Triggering function>
         catch(const IGException& ige)
              <Handling Code>
    The code which throws the exception is a static method of IGException which has a basic throw line:
         throw IGException(...);
    Source code is compiled with the following flags, none of which I could find any info to suggest affect this:
    CC -c -Xt -xCC -misalign -xarch=v9 -O
    Linking of the shared object is then done via the following, again nothing obvious that could cause issues. mapfile is an empty file.
    ld -o <outputfilename> -G -z textoff -M mapfile -z noversion -64 -h <outputfilename> <object files> -L/opt/SUNWspro/lib/v9 -lCrun -lX11 -lc -lm
    I did read somewhere mentioning to make sure to use RTLD_GLOBAL if using dlopen on the .so, but the test app is using ld to link the library.
    Does anyone have any ideas why with the Sun Studio 9 compiler these exceptions are not being caught? Based on the fact they are caught on all other compilers, i'm guessing this issue is with the compiler.
    Also, as a test it seems that if the shared object is not built as a 64-bit object, then everything works. The issue only seems to occur when it is a 64-bit object. Likely an issue with the 64-bit compiling?
    Edited by: 837682 on Feb 17, 2011 9:23 AM

    As the other poster pointed out, you need to link the shared library using CC, not ld. I should have noticed that error in the original post.
    Try using CC instead of ld in your link command. The CC command causes additional files to be linked into the shared library that are required for proper operation, and particularly for exception handling. I think that is the actual source of your problem.
    You should not use -L options that point into the compiler installation area, and when you use CC to link, you don't need to.
    I'm surprised that you seem to have a copy of libCrun.so.1 in the compiler installation area -- that should not be the case. The the only versions of libCrun should be static libraries libCrun.a. You almost never want to link with a static version of a system library, and absolutely never when building a shared library. The file /opt/SUNWspro/lib/libCrun.so.1 ought to be a symbolic link pointing to /usr/lib/libCrun.so.1, but if that were the case, the version command would have the same output.
    By any chance, did you install your compiler by copying it from another installation? If you do that, you need to use tar, not cp, to ensure that symbolic links are preserved.

  • How to create the shared library?

    I am new to this topic. I would like to know how I should create the shared library? I followed the provided lesson's steps and in step 5, it states that a shared library has to be create.
    I am using Win2000 and I have installed Visual C++ 6.0, and when I try the command "cl -Ic:\java\include -Ic:\java\include\win32 -LD HelloWorldImp.c -Fehello.dll", there is an error said that it can't find the mspdb60.dll?
    what is the problem? and what should I do?
    please help.
    Thanks.

    I am new to this topic. I would like to know how I should create the shared library? I followed the provided lesson's steps and in step 5, it states that a shared library has to be create.
    I am using Win2000 and I have installed Devc++ 4.9.8.0 and when I try the command "cl -Ic:\java\include -Ic:\java\include\win32 -LD HelloWorldImp.c -Fehello.dll", but it reports as: "accepting connections" or "press any key to end CL"
    what is the problem? and what should I do?
    please help.
    Thanks. please send me e-mail: [email protected]

  • Can allication reffer the shared library using STL?

    I want to make the shared library which using STL, and make application using this liblary.
    I suceed making shared liblary which using STL, but failed to building allication program. The error message is following ...
    /opt/SUNWspro/bin/CC -Kpic -g -mt -V -D_REENTRANT -DFSUN -D_DEBUG -I/export/home/efm/kawaha/EFCFEnv/include -o ./TestDriver.exe SampleDriver.cpp -L/export/home/efm/kawaha/EFCFEnv/lib -L/usr/j2se/jre/lib/sparc/server/ -L/opt/SUNWspro/lib -L/opt/SUNWspro/WS6U1/lib -lhtefcfenv -L/usr/j2se/jre/lib/sparc/server/
    CC: Sun WorkShop 6 update 1 C++ 5.2 2000/09/11
    ccfe: Sun WorkShop 6 update 1 C++ 5.2 2000/09/11
    CClink: Sun WorkShop 6 update 1 C++ 5.2 2000/09/11
    CC: Sun WorkShop 6 update 1 C++ 5.2 2000/09/11
    /opt/SUNWspro/bin/../WS6U1/bin/c++filt: Sun WorkShop 6 update 1 C++ 5.2 2000/09/11
    ld: Software Generation Utilities - Solaris-ELF (4.0)
    Undefined first referenced symbol in file
    __type_1 std::copy<EFCFMapValue**,EFCFMapValue**>(__type_0,__type_0,__type_1) /export/home/efm/kawaha/EFCFEnv/lib/libhtefcfenv.so
    unsigned __rwstd::__rb_tree<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::pair<const std::basic_string<char,std::char_traits<char>,std::allocator<char> >,EFCFMapValue*>,__rwstd::__select1st<std::pair<const std::basic_string<char,std::char_traits<char>,std::allocator<char> >,EFCFMapValue*>,std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<const std::basic_string<char,std::char_traits<char>,std::allocator<char> >,EFCFMapValue*> > >::count(const std::basic_string<char,std::char_traits<char>,std::allocator<char> >&)const /export/home/efm/kawaha/EFCFEnv/lib/libhtefcfenv.so
    ld: fatal: Symbol referencing errors. No output written to ./TestDriver.exe
    *** Error code 1
    make: Fatal error: Command failed for target `TestDriver.exe'
    Instanciated symble exit SunWS_cache. I did not know that how application to reffer this symbol.
    Can the applicaton reffer the shared library using STL?
    or
    Can the applicaton reffer the static library using STL?
    Mihoko

    It seems in ur application,u use STL,but not include the STL header files,just include the right STL header files and "usring namespace std;" in ur application,i think will solve ur problem.

  • Unable to create a shared library

    hi
    My name is Prabhu and i am new to this forum. I hope to be a constructive addition to the forum. But, i am starting of with a problem i am facing. :) I would be grateful if someone can provide some pointers for the same.
    I am trying to migrate a tool to SS11 compiler for solaris 5.9. Unfortunately, I am unable to build shared libraries. The linking fails saying
    ld: fatal: file tmp.o : section function(): has invalid sh_info: 0
    This tmp.o is a relocatable object file composed of many other object files. These leaf level object files were not compiled with -KPIC though as solaris actually creates relocatable object files. Is this correct? Previously, we used -KPIC to create the object files used as input to a shared library but I removed this on the basis of a suggestion given from someone.
    Can someone please let me know what could be the issue here? My email id is [email protected]
    Thanks in advance

    To add a jar file inJDeveloper, go to Tools -> Project Properties -> Libraries and click on Add Jar/Directory button to add desired jar files.
    Thanks
    Shree

  • How to configure Class Loading-Import Shared Library using admin_client

    i am deploying ear using below command through command prompt.its deployed successfully.
    java -jar ../admin_client.jar deployer:oc4j:localhost:23792 oc4jadmin oc4jadmin -deploy -file C:/ex.ear -deploymentName ex -bindAllWebApps
    i have one requirement if i deploy thorugh command prompt. while deploying ear through admin console in Deploy: Deployment Settings-Configure Class Loading-Import Shared Libraries-i checked JAXB then the ear will be deployed successafully.
    i need to incorporate same thing in above command also.i have created shared library and jars are placed in this path.
    C:\Oc4J\j2ee\node1\shared-lib\JAXB\2.0
    but while deploying ear using admin_client.jar command script i need to configure classs loading and import above shared library.how to modify the script?

    Ours is not a Desktop Application, but we want to handle Authentication(Which authenticates the userid and password by making a Tuxedo call) and add the Principal to Subject in session, so that ADF Authorization and securityContext can be used as is,
    but doing this with Custom Authentication Provider in weblogic needs me to have a lot of Tuxedo Service related jars in weblogic/system classpath which i feel is not right thing to do, as the same jars are required in application also, which means i will have the jars in class path twice and i need to deploy the jars to both places everytime there is any change.
    Is there any way by which i can set Authenticated principal to Subject in the created session from within Application?

  • How do I create a shared library from iPhoto when the file is too large to burn on DVD?

    I  need to remove some photos (70 GB) to relieve a full hard drive.  I have exported and burned .jpg images on DVDs, but that is only useful as a worst case backup.  What I would like to have is a separate iPhoto Library for each calendar year of photos, so I could still view them in the albums and folders I have created to organize them.  I have done this before in an earlier version of iPhoto, and was able to create 2003 iPhoto Library, 2004 iPhoto Library, etc.  I put a copy on DVD (the full year fit on 1 DVD) and another copy on an external drive. 
    I am having problems doing this with iPhoto '09 (version 8.1.2).  The iPhoto library for each year is too large to burn on DVD.  When I select certain albums from the year that will fit on DVD and use the Share>Burn commands, it creates a library with Events and Faces, but none of the albums are listed on the left.  The albums are important to organize the photos for viewing (birthdays, vacations, holidays, etc.)  I didn't always pay attention to labeling Events when I imported photos, so that is not an adequate alternative to my albums.
    I was thinking that if I could create a library for the entire year, it might include my albums and folders. I would have space for this on my external hard drive.  However, I can find no way to create a library for the entire year and put it on my external drive - the only option is to burn a DVD or export .jpg images.
    Any suggestions would be appreciated.

    Best suggestion: Buy some external USB or Firewire drives. Move your Library to one, back it up to another. A lot more reliable than DVD, a lot less work and much more convenient. For a start, you don't have to break up the library...
    Regards
    TD

  • How to create a static library using xcode ?

    Hi,
    I need to create a C static library using xcode in order to use it in another developement environment which is Free Pascal Compiler/Lazarus.
    I have very few knowledge about C. I just know how to program the function I need and I've already written my C function using xcode.
    Using Lazarus (Pascal IDE), for example, as I use IOKit, I have declared the path of IOKit in the linking section (that is /Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/IOKit.framework/IOkit) . IOKit is a unix executable, and I can use the exported functions it contains in my Pascal code.
    So, I would build such kind of unix executable where I can put my own functions written in C. But I can't figure out how to do it.
    How to export my functions ? Must I use some specific C keywords to "publish" them (export, __export,...) ? How to create an executable file like IOKit ? Which kind of project must I choose in XCode ?...
    André.
    Message was edited by: sinfoni12345
    Message was edited by: sinfoni12345

    Thanks for the response.  Yes, that's how I started.  I have now managed to get it to build static libraries; the piece I was missing was the scheme stuff.  I also tried to build dynamic libraries, but still no luck with those.  It was a little confusing because sometimes if I started a new project the scheme would allow me to create output as is; other times I had to edit the scheme first.  So reading the documentation appears to have paid off after all.
    FWIW, what I was trying to build was a missing library needed for a project in Python.  The entire project has two C libraries, which I've managed to build now, altough I don't know if there are some specific options that I need to set for them to work with the C wrapper.  The C wrapper is written in Cython, which creates a C file from Python-like statements.  The end result of linking the two libraries and the compiled C wrapper should be a file that can be imported into Python, which should have an extension of ".so".
    So far the last part is not working, so I don't know if the problem is with the build settings for the libraries, or something else.

  • How to create an Assets Library using C# in SharePoint 2010?

    currentWeb.Lists.Add(
    "List Name",
    "List Description",
    SPListTemplateType.AssetsLibrary);
    This code does not work for me in Visual Studio. The SPListTemplateType enumerator does not have an assets library item.
    How can I programmatically create an Assets Library?

    To create an assets library you must activate first the Site Collection's Publishing Feature in order to set the availabilty of the "Asset Library" template.
    If not, no template on system and of course, error on code "Object reference not set to an Object......"
    Use this code:
    using (SPSite oSite = new SPSite(myUrl))
    if (oSite != null)
    using (SPWeb oWeb = oSite.OpenWeb())
    if (oWeb != null)
    oWeb.AllowUnsafeUpdates = true;
    //activating web feature
    Guid guidCollectionPublishingfeature = new Guid("F6924D36-2FA8-4f0b-B16D-06B7250180FA");
    //activating site feature first
    if (oSite.Features[guidCollectionPublishingfeature] == null)
    oSite.Features.Add(guidCollectionPublishingfeature, true);
    if (site.Features[guidCollectionPublishingfeature] != null)
    SPListTemplateCollection templateCol = web.ListTemplates;
    foreach (SPListTemplate t in templateCol)
    if (t.Name == "Asset Library")
    SPListCollection coll = web.Lists;
    Guid guid = web.Lists.Add("listname", "listdescription", t);
    coll[guid].Update();
    oWeb.AllowUnsafeUpdates = false;

  • Unable to see shared library using fast user switching?

    I couldn't get iPhoto 5.04 sharing to work between two users on a single machine. The documentation and this thread say it should work:
    lori_diloreto, "How can you share a iPhoto library with another account user" #1, 09:03am May 10, 2005 CDT
    but it didn't. Personal file sharing is enabled. iPhoto Bonjour sharing is enabled on the firewall. I can share iTunes libraries between the two users.
    So I restarted the machine and tried again. It worked.
    I don't know why the restart was necessary ...
    BTW, I'd recommend more than my 512MB of DRAM when doing this. I'm amazed the G5 works as well as it does with so little physical memory. Tiger's disk swapping must be superb -- but I think at least 1GB would be adviseable.

    Hi jfaughnan,
    Rebooting can cure a lot of little quirks. If all else fails when I try to do something and it's not working, I reboot and see if it helps. Usually it does.

  • How can I create a shared review using a web-based mail account?

    I believe I should be able to do this using Acrobat 11 for Windows XP (I have the trial version), but I can't figure out how. We use Google Mail. Help says to:
    (Windows) Double-click Internet Options in the Control Panel. In the Internet Properties dialog box, select the Programs tab, and then select the preferred email application. Restart Acrobat to activate the change. 
    (Windows) Change the MAPI settings in your email application. Acrobat and Reader use the Messaging Application Program Interface (MAPI) to communicate with your email application. Most email applications come with MAPI settings to handle this communication. For more information on configuring your email applications, see the email application’s Help.
    Google Mail doesn't show up in my Internet Properties/Programs/E-mail list, and as far as I can tell, Google Mail doesn't have any MAPI settings to adjust.
    Any tips?
    Thanks.

    In Acrobat XI you can find this setting under Edit > Preferences > Email accounts. You can add your gmail account here. Here is a tutorial on How to use webmail in Acrobat.

  • Is there an easy way to create simple forms for use in iweb?

    or a template?
    I need to create a reply form on the site I am working on.
    thanks

    After a few days of working on this issue the tutorial is updated to make the form be sent from within the webpage with extra form additions available as well!
    The form is fully customizable for background color or image background, there's no ads or service to sign up for, all you have to do is copy and paste a code into your html and enable cgi and/or php on your host with some additional small tweeks here and there to put it all together. Basically it's the do it yourself way.
    *The form on the tutorial link provided still opens the Email app when the form is submitted but we have tested this method on our other sites using the same procedures mentioned with successful results.

  • Building shared library

    I am a new user to Mac and I am trying to build a shared library using gcc. However, I am getting errors when creating a execuatble.
    My system info. is:
    [email protected] <810> gcc --version
    i686-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build 5363)
    [email protected] <811> uname -a
    Darwin foxtrot.vni.com 8.8.1 Darwin Kernel Version 8.8.1: Mon Sep 25 19:42:00 PD
    T 2006; root:xnu-792.13.8.obj~1/RELEASE_I386 i386 i386
    Here is a small example for the problem.
    ========= kk.h ===========
    #include<stdio.h>
    #include<math.h>
    void sub();
    =========== sub.c =========
    #include "kk.h"
    void sub() {
    printf("sub = %g\n", fabs(-2.0));
    ======== main.c ========
    #include "kk.h"
    main() {
    sub();
    =====================
    [email protected] <792> gcc -c -fPIC sub.c
    [email protected] <793> gcc -o libkk.so -dynamic -r sub.o
    [email protected] <794> gcc main.c libkk.so -lm
    /usr/bin/ld: multiple definitions of symbol _NXArgc
    /usr/lib/gcc/i686-apple-darwin8/4.0.1/../../../crt1.o definition of _NXArgc in section (_DATA,_data)
    libkk.so definition of _NXArgc in section (_DATA,_data)
    /usr/bin/ld: multiple definitions of symbol _NXArgv
    /usr/lib/gcc/i686-apple-darwin8/4.0.1/../../../crt1.o definition of _NXArgv in section (_DATA,_data)
    libkk.so definition of _NXArgv in section (_DATA,_data)
    /usr/bin/ld: multiple definitions of symbol _progname
    /usr/lib/gcc/i686-apple-darwin8/4.0.1/../../../crt1.o definition of _progname in section (_DATA,_data)
    libkk.so definition of _progname in section (_DATA,_data)
    /usr/bin/ld: multiple definitions of symbol _environ
    /usr/lib/gcc/i686-apple-darwin8/4.0.1/../../../crt1.o definition of _environ in section (_DATA,_data)
    libkk.so definition of _environ in section (_DATA,_data)
    /usr/bin/ld: multiple definitions of symbol start
    /usr/lib/gcc/i686-apple-darwin8/4.0.1/../../../crt1.o definition of start in section (_TEXT,_text)
    libkk.so definition of start in section (_TEXT,_text)
    collect2: ld returned 1 exit status
    Thank you.

    Hi Gschwert,
    our developers told me that for X-Code Version 4 you need an additional download. Then, it should also work with Version 4. Here is what they said:
    It turned out that Shared Libraries compile fine with XCode 4, it's just that the command line tools that we need for compilation are now an optional download. 
    From https://developer.apple.com/xcode/ 
    "Xcode includes a new "Downloads" preference pane to install optional components such as command line tools, and previous iOS Simulators." 
    So, this is not well documented we will handle that and let make a correction as soon as possible.
    Have a nice day,
    Abduelkerim
    Sales
    NI Germany

  • Compilation error in creating shared library via JNI

    Hi ALL,
    I amin serious trouble with a problem. I am developing a Simulator, a function of which is to decode MPEG-2 Video files in real time and play it as well.I have got a MPEG-2 Decoder implemented in C from an open source and need to integrate with my Simulator which is writtebn in Java. The integration part I am doing via JNI(Java Native Interface). Now I have a bunch of C files in MPEG-2 decoder which are to be compiled during the Execution of the Java Simulator.Can anybody give some idea about how to call multiple C files from the Java Source through JNI at one go? Another problem I am facing is in calling a single C code from the traditional "HelloWorld" Java Code itself. The problem comes when I am trying to compile the shared library between the C native code and Java Code in my Linux Machine...I am getting the following message:
    /usr/lib/gcc-lib/i386-redhat-linux/2.96/.../../../crt1.0 : In function '_start' :
    /usr/lib/gcc-lib/i386-redhat-linux/2.96/.../../../crt1.0(.text+0x18): undefined reference to 'main'
    collect2: ld retrurned 1 exit status
    What does the above errot mean? How to rectify it.It will be of great help if you anybody can give me clues.

    It means that your compiler options are wrong.
    You need to create a shared library.
    Instead you are creating an executable, which is not the same as a shared library.
    If you search this forum you will find posts with command line options that work.

Maybe you are looking for

  • Is there a way to force a download option?

    Hello My boss asked me this question: is there a way to force a link (PDF in this case) to open the dialog box for an option of save to file or open? Thanks Rob

  • CASE Expression question

    Hi, I am wondering how to implement case logic where THEN statement would be written only once for many WHEN's. This example is from the oracle documentation, I extended it a bit. SELECT cust_last_name, CASE credit_limit WHEN 100 THEN 'Low' WHEN 200

  • [Solved] Auto-open a file manager after mounting with udev rules

    Hellooooo, I followed the udev Wiki for auto mounting USBs and it now works great. The only problem is: how can I automatically open a file manager of the mounted directory? I tried putting this at the end of the "ACTION=="add"," section in "/etc/ude

  • Bill to & Ship to address change at AR Invoice Level

    After AR Invoice I unable to change Ship to Address but I can change same Bill To Address Is there any Reason?? Actually there is wrong Ship to Adress follow by User so he need to change that..Please help..

  • Web Analysis Crashes

    Hi, I just installed Web Analysis 11.1.1.3 on windows 2003 x64. I used WebLogic 9.2 as web server. The services goes up without a problem. When I call the web page http://10.253.125.65:16000/WebAnalysis/WebAnalysis.jsp it opens de page and starts loa