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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:10:59+00:00 2026-05-26T15:10:59+00:00

I want to import functions from another file in Microsoft Visual C++ 6.0. How

  • 0

I want to import functions from another file in Microsoft Visual C++ 6.0. How can i do this? I have tried with this as follows:

#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#import <functions.cpp>

where functions.cpp is the file name from where I want to import the functions. But this gives an error: F:\CC++\Term Project\Dos Plotter\Functiom Plotter.cpp(6) : fatal error C1083: Cannot open type library file: ‘Functions.cpp’: No such file or directory

How can I solve this problem?

  • 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-26T15:11:00+00:00Added an answer on May 26, 2026 at 3:11 pm

    The #import directive is used with type libraries, often COM or .Net, not C++ source files. For complete details, see the MSDN page.

    In order to include C++ functions from another file, you typically want to use the #include directive (details). This includes the code from the given file during compilation. Most often, you should include a header containing the function prototypes; it is possible to include code files, but not commonly needed or always safe.

    To do this, you should provide two files, a header and a source file, for your functions.
    The header will read something like:

    #pragma once
    
    void Function(int arg);
    

    and the source:

    #include "functions.hpp"
    
    void Function(int arg) { ++arg; }
    

    To use this in another file, you do:

    #include "functions.hpp"
    
    void OtherFunction()
    {
        Function(2);
    }
    

    You should also note that a header should typically be included only once. The MSVC-standard method of guaranteeing this is to add #pragma once to the beginning.

    Edit: and to address the specific error you’ve posted, which applies to both #import and #include, the file you’re attempting to include must be somewhere within the compiler’s search path. In Visual Studio, you should add the necessary path to the project includes (this varies by version, but is typically under project properties -> compiler).

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

Sidebar

Related Questions

I have a method I want to import from a DLL and it has
I have a MySQL file which I want to import via PHP 5. In
I have an UTF-8 encoded txt file and I want to import it to
I am trying to import one python script from another. I have a few
I have a file named common.cs which contains commonly used functions like this public
i have a generate(variable) function in another file, i want to call it in
I want to import an oracle dump into a different tablespace. I have a
i want to import in my iphone application, but i know this framework is
i Want to import a given css or javascript file depending os some conditions,
I want to import the contents of a csv file into R, the csv

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.