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 9225315
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:32:50+00:00 2026-06-18T04:32:50+00:00

OK, I’m currently playing with D (for the first time), so supposedly I’ll be

  • 0

OK, I’m currently playing with D (for the first time), so supposedly I’ll be having some ultra-basic question… And here I am… 🙂

When I compile-link with dmd it compiles fine :

dmd myMain.d myTestModule.d

When setting the -v (verbose) flag, I noticed the process is basically a compilation step (with -c flag) and linking (with gcc) as usual.

However, when I’m trying compiling the following way, I keep getting errors :

dmd -c MyMain.d myTestModule.d
gcc MyMain.o -o MyMain -m64 -lphobos2 -lpthread -lm

Undefined symbols for architecture x86_64:
  "_D8someFunc3strFmZAya", referenced from:
      __Dmain in MyMain.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status

What’s going on? Any ideas?

  • 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-18T04:32:52+00:00Added an answer on June 18, 2026 at 4:32 am

    Compiling produces object files that may reference external symbols. Linking is the process of combining group of relevant object files into resulting single binary, taking care of all those external references between them, among other tasks.

    Each source file is compiled into one matching object file. In your case, you have compiled myMain.d and myTestModule.d, so there have appeared two object files: myMain.o and myTestModule.o. But you provide only one of them to linker (via gcc) and that predictably results in some symbols unresolved.

    gcc myMain.o myTestModule.o -o MyMain -m64 -lphobos2 -lpthread -lm
    

    …should do the trick.

    Also note that you can use the very same dmd binary for invoking linker and than it will take care about linking default stuff (phobos, pthread etc.) for you:

    dmd myMain.o myTestModule.o -o MyMain -m64
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
We're building an app, our first using Rails 3, and we're having to build
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
This could be a duplicate question, but I have no idea what search terms
I don't have much knowledge about the IPv6 protocol, so sorry if the question
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out

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.