Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9118549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T05:10:49+00:00 2026-06-17T05:10:49+00:00

I have to port an existing code written in C and C++ to iOS.

  • 0

I have to port an existing code written in C and C++ to iOS.

This code, at some point, uses the environ variable to access all the environment variables.

When compiling this code with the iOS compiler toolchain, it complains that environ is not a defined symbol. I couldn’t find any header that would provide it or any suitable alternative.

Unfortunately, environ is used to get all the environment variables and pass them to a sub-routine. That is, getenv() is not an option, since we don’t know what environment variables to check for.

Is there a way in C or C++ code, with the iOS compiler toolchain, to access to the environ variable ? Or do you know any alternative solution ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T05:10:50+00:00Added an answer on June 17, 2026 at 5:10 am

    The environ variable must be declared in the user program, in your C code. So just declare it like this before accessing:

    extern char **environ;
    

    You may also find this article about iOS environment helpful (it has an example project as well).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some existing Java code that uses java.nio.file.Files.walkFileTree with the FileVisitor interface, but
I have to port some crypto code to visual c++ from java which (visual
I have written a program which triggers a relay switch on a serial port.
I want to port some existing j2se libraries (e.g. Apache Compression libs) to use
I have an existing embedded source code which runs directly on a microcontroller with
I have existing C++ lib containing many different classes working together. Some example usage
I have an application which, for convenience (I am reusing existing code) has been
I have an existing ASP.NET website with some custom routing, within a Solution that
I have an existing multi-threaded application which uses blocking connect() call. However, I want
We've got some old serial code which checks whether a serial port is available

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.