[prev in list] [next in list] [prev in thread] [next in thread] 

List:       activemq-dev
Subject:    [jira] Resolved: (AMQCPP-210) ActiveMQ-CPP on Mac OS X and iPhone
From:       "Timothy Bish (JIRA)" <jira () apache ! org>
Date:       2009-04-27 14:53:38
Message-ID: 1506422383.1240844018612.JavaMail.jira () brutus
[Download RAW message or body]


     [ https://issues.apache.org/activemq/browse/AMQCPP-210?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel \
]

Timothy Bish resolved AMQCPP-210.
---------------------------------

    Resolution: Fixed

Patch applied with modification:  Resolved issue in trunk and in 2.x branch.

> ActiveMQ-CPP on Mac OS X and iPhone OS link error
> -------------------------------------------------
> 
> Key: AMQCPP-210
> URL: https://issues.apache.org/activemq/browse/AMQCPP-210
> Project: ActiveMQ C++ Client
> Issue Type: Bug
> Components: Decaf
> Affects Versions: 2.2.2, 2.2.3, 2.2.4, 2.2.5
> Environment: Mac OS/X iPhone build
> Reporter: Timothy Bish
> Assignee: Timothy Bish
> Fix For: 2.2.6, 3.0
> 
> 
> Created this from an email
> ---Email From - Chris Campbell---
> Thanks for the excellent work on ActiveMQ-CPP! We're using it with  
> great success in several of our projects.
> I downloaded version 2.2.2 today and needed to patch src/main/decaf/ 
> lang/System.cpp to get it to work on Mac OS X and iPhone OS. Not sure  
> which variant of 2.2 I was using before, but I didn't recall patching  
> it.
> For use in our software, I compile ActiveMQ-CPP as a static library  
> (libactivemq-cpp.a) and link it into a Mac OS X framework for use with  
> our Mac OS X applications, or link it directly into an iPhone  
> application (you're not allowed to build frameworks on the iPhone).
> ActiveMQ-CPP 2.2.2 will successfully compile and link on Mac OS X, but  
> if you attempt to use the static library in a non-executable (like a  
> shared library or a framework) you get an error at link time that the  
> "_environ" symbol could not be found. The reason for this error is  
> explained at:
> http://lists.apple.com/archives/xcode-users/2004/Jan/msg00230.html
> I changed System.cpp by adding the following OS X-specific  
> implementation of System::getEnvArray() in src/main/decaf/lang/ 
> System.cpp, created by slightly modifying the non-WIN32 version:
> --- BEGIN patch ---
> --- activemq-cpp-2.2.2-src/src/main/decaf/lang/System.cpp.orig   
> 2008-12-02 23:51:46.000000000 -0500
> +++ activemq-cpp-2.2.2-src/src/main/decaf/lang/System.cpp       2008-12-02  
> 19:16:00.000000000 -0500
> @@ -208,6 +208,30 @@
> return buffer;
> }
> +#elif defined(__APPLE__)
> +
> + 
> ////////////////////////////////////////////////////////////////////////////////
> +char*** _NSGetEnviron(void);
> +
> + 
> ////////////////////////////////////////////////////////////////////////////////
> +std::vector<std::string> System::getEnvArray() {
> +
> +    std::vector<std::string> buffer;
> +    int count = 0;
> +
> +    char **environ = *_NSGetEnviron();
> +
> +    for( int i = 0; *(environ + i); i++ ){
> +        count++;
> +    }
> +
> +    for( int i = 0; *(environ + i); i++ ){
> +        buffer.push_back( environ[i] );
> +    }
> +
> +    return buffer;
> +}
> +
> #else
> ////////////////////////////////////////////////////////////////////////////////
> --- END patch --
> BTW, what's the first for loop doing? It calculates "count" but  
> doesn't use it for anything later in the function?
> Anyway, thanks again for the great software. Wanted to send you the  
> patch, and thought you might be interested to know that ActiveMQ-CPP  
> is working well on the iPhone!

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic