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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T15:27:06+00:00 2026-05-15T15:27:06+00:00

I have recently started experimenting with LLVM under MinGW. I have read the Kaleidoscope

  • 0

I have recently started experimenting with LLVM under MinGW. I have read the Kaleidoscope tutorial but now I’m having problems with external functions.

I’m declaring external functions like this:

const Type* doubleType = Type::getPrimitiveType(ctx, Type::DoubleTyID);
std::vector<const Type*> doubleParams;
doubleParams.push_back(doubleType);
FunctionType* doubleDouble = FunctionType::get(doubleType, doubleParams, false);
Function* SinFunction = Function::Create(doubleDouble, Function::ExternalLinkage, "sin", mod);

Where mod is the Module* and ctx is the LLVMContext&.

In this case, everything works properly.
However, if I declare a function:

extern "C"
double my_cubic_transform(double x) {
    return x*x*x;
}

And change the SinFunction declaration from using “sin” to using “my_cubic_transform”(without changing anything else), then I get:

LLVM ERROR: Program used external function 'my_cubic_transform' which could not be resolved

Changing my makefile to include the “-g” option no effect.
The Kaleidoscope tutorial suggested this was possible in LLVM(at least for JIT, which I am using). So am I doing something wrong? If so, what?

  • 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-05-15T15:27:07+00:00Added an answer on May 15, 2026 at 3:27 pm

    Never mind, I figured it out.

    Turns out that even though I am using an executable(exe) and not a dll, I have to declare my_cubic_transform with __declspec(dllexport).

    Whoever wrote the tutorial must’ve used some other platform where __declspec doesn’t exist and therefore didn’t find this problem.

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

Sidebar

Related Questions

I have recently started having problems with TortoiseCVS, or more specifically with plink, the
I have recently started experimenting with Django for some web applications in my spare
I have recently started exploring Maven, but I feel a bit overwhelmed of all
I have recently started using PlayN for a hobby project and has now stumbled
I have recently started learning C++, but I require a compiler. I have tried
I'm trying to get my ad hoc build distributed but have started experiencing problems.
I have recently started a tutorial to learn how to code GUI using Windows
I have recently started messing round with CodeIgniter and ran into problems when doing
I have recently started to use Web Expression 4. I was under the impression
I have recently started programming in Perl (I'll skip the long story) but I've

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.