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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:07:26+00:00 2026-06-17T18:07:26+00:00

I am calling a BLAS function in my code by including the BLAS library,

  • 0

I am calling a BLAS function in my code by including the BLAS library, and my code apparently is faulty somehow, as the compiler spits out the error: “ddot was not declared in this scope.”

#include <stdio.h>
#include <stdlib.h>
#include <blas.h>

int main()
{
        double  m[10],n[10];
        int i;
        int result;

        printf("Enter the elements into first vector.\n");
        for(i=0;i<10;i++)
        scanf("%lf",&m[i]);

        printf("Enter the elements into second vector.\n");
        for(i=0;i<10;i++)
        scanf("%lf",&n[i]);

        result = ddot(m,n);
        printf("The result is %d\n",result);

        return 0;
}

Any ideas on how I can fix this code properly?

  • 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-17T18:07:26+00:00Added an answer on June 17, 2026 at 6:07 pm

    When calling from C, the function name must either be cblas_ddot() (C calling conventions) or ddot_ (fortran calling conventions; note the trailing underscore.)

    You are missing some function arguments. Try

    result = cblas_ddot(10, m, 1, n, 1);
    

    or equivalently

    int len = 10, incm = 1, incn = 1;
    // ...
    result = ddot_(&len, m, &incm, n, &incn);
    

    Also, ddot returns a double but you are assigning the result to an int.

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

Sidebar

Related Questions

Calling the function MakeTree(4, gameboard) does not work properly, it only prints out the
Calling the function on load and the error is pointing to that. I don't
Calling system() to run an external .exe and checking error code upon errors: #include
Calling Virtual methods during construction and destruction causes a compiler error? I heard that
Calling the WriteObject Method from a background thread is not possible! Is there a
Calling a Lua function from C is fairly straight forward but is there a
Calling Index view is giving me this very very annoying error . Can anybody
Calling setFocus(null) on the ItemizedOverlay does not 'unfocus' current marker. According to the documentation:
Calling Thread.join blocks the current (main) thread. However not calling join results in all
Calling the javascript gurus out there. Basically my question is regarding how you structure

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.