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

  • Home
  • SEARCH
  • 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 8137619
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T11:11:43+00:00 2026-06-06T11:11:43+00:00

I’m trying to port a program written in Microsoft Visual Studio (in c, c++

  • 0

I’m trying to port a program written in Microsoft Visual Studio (in c, c++ and fortran) to a mac OSX. Within this program is a c++ function being called by a fortran source code. Basically its interloping c++ and fortran. I have wrapped the C++ function in an "extern C" brackets, which I’m told via the internet is the proper method. However, the linker is still complaining of an undefined symbol within this c++ function…

Undefined symbols:
  "__Z7_getcwdPci", referenced from:
      _bisimr_ in bisimR.o
ld: symbol(s) not found

if you look through the internet, getcwd is a function defined in a header file, "direct.h". It is not part of the mac OS and is only inherent on a Windows system. I was able to find the file on the internet that, to the best of my knowledge, seems to be the windows “direct.h” file.

Now that we are done with the context, here is my question

Given that I get an error, could it be that my direct.h file is not the correct header file that is part of Windows? or is name mangling, going from C++ to fortran, throwing out this error?

note:

  • I can get through the compile stage, its the linking of the libraries that throws this error.
  • bisimr_ is the c++ function
  • 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-06T11:11:45+00:00Added an answer on June 6, 2026 at 11:11 am

    As far as I understand your question, you tried to build the program by copying a header file from a Windows system. Right so far? That approach is bound to fail: the presence of the header file will provide the compiler with information as to what functions are available on a Windows system, but the linker will complain because none of the listed libraries defines a function of said name.

    You should only be using headers which come with your system, or from third-party libraries which you already compiled successfully for your system. Sourcecode-only headers (template libraries in particular) are OK as well. The use of any other header is just asking for linker errors.

    The fact that the name appears mangled is an indication that the compiler considers it a C++ function which might be overloaded, so it will include details about the argument types in the name. That aspect might be avoided by enclosing the #include statement in an extern "C" block. For the windows file direct.h this will not solve the above problems, but perhaps it will make unistd.h useful to you:

    extern "C" {
    #include <unistd.h>
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I am trying to render a haml file in a javascript response like so:
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString

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.