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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T19:07:44+00:00 2026-06-06T19:07:44+00:00

I have a very simple C++ file Multiplier.cpp with the corresponding header file, from

  • 0

I have a very simple C++ file Multiplier.cpp with the corresponding header file, from which I have created a library using the following commands

$ g++ -o Multiplier.o -c Multiplier.cpp
$ ar cr libMultiplier.a Multiplier.o

In a new directory, I have created a Calculator.cpp (with corresponding header file) which uses the Multiplier class. the header file Calculator.h has the corresponding `#include “Multiplier.h”

The header file Calculator.h has the corresponding #include "Multiplier.h"

I copied the created library into this directory I tried to compile Calculator.cpp using the following command:

$ g++ -o Calculator Calculator.cpp -L. -lMultiplier

which gives me these errors:

In file included from Calculator.cpp:1:
Calculator.h:1:24: error: Multiplier.h: No such file or directory
In file included from Calculator.cpp:1:
Calculator.h:6: error: ISO C++ forbids declaration of ‘Multiplier’ with no type
Calculator.h:6: error: expected ‘;’ before ‘&’ token
Calculator.h:8: error: expected `)' before ‘&’ token
Calculator.cpp:5: error: redefinition of ‘class something::Calculator’
Calculator.h:5: error: previous definition of ‘class something::Calculator’`

I have searched for a long time but can’t work out what is happening.
I am using GCC 4.2.1.

  • 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-06T19:07:45+00:00Added an answer on June 6, 2026 at 7:07 pm

    Your include file Multiplier.h is in another folder. How do you expect the compiler to find it? You need to tell the compiler where the file is, either using the -I command line flag and supplying the path of the include file, or using a path in the #include directive.

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

Sidebar

Related Questions

I have a very simple page with which a user uploads a file. Using
I have a very simple python script that should scan a text file, which
I have created a very simple window service using visual studio 2010 and .NُET
I have created a very simple PHP file that does very simple job, it
I have a very simple fxml file, with a checkbox: ... <AnchorPane id=AnchorPane xmlns:fx=http://javafx.com/fxml
I have a very simple xhtml file where a panelGroup containing a commandButton is
I have a very simple .htaccess file set up to redirect a 404 to
I have a map that reads an XML file; it's all very simple and
I'm trying to apply an xlst transformation using the following file. This is very
I have very simple form, with input like this: <input id=my_id multiple=true type=file name=image_name[]

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.