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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:59:32+00:00 2026-05-25T13:59:32+00:00

I have very basic QT application (just create to explain my problem). So here

  • 0

I have very basic QT application (just create to explain my problem).
So here I go 🙂 I have two folders, f1 and f2, and they are on same level (have same folder for parent). In f1 I have source code from my project, and in f2 another project.
For sake of this example, let’s say that in f1 I have only common.h and common.cpp, and in f2 I have:

Test.pro

SOURCES = main.cpp
INCLUDEPATH += "..//f1//"

main.cpp

#include <common.h>
#include <QDebug>

int main(int argc, char *argv[])
{

    qDebug()<<CalculateMD5("test");
}

When I try to build this project (Test.pro) I get following error:
f2/main.cpp:7: undefined reference to `CalculateMD5(QString)’

What am I doing wrong ? How should I include code from another project ?
I need CalculateMD5 function to be global.

Here you can download whole example (1kb):
http://www.xx77abs.com/test.rar

Thanks !!

  • 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-25T13:59:33+00:00Added an answer on May 25, 2026 at 1:59 pm

    For the simplest change, I think you need to change your .pro file to this:

    Test.pro

    SOURCES = main.cpp ../f1/common.cpp
    INCLUDEPATH += "..//f1//"
    

    If you have other code that will also be linking in common.cpp, then a better change would be to make a .pro file in f1 that generates a library, to be linked in to other applications.

    But just manually adding common.cpp to your list of sources should do the trick.

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

Sidebar

Related Questions

I have just create a very basic Dynamic Data web application using Entity Framework,
I have a very basic texture map problem in GL on iPhone, and I'm
Well, I think I have a very basic doubt here: I'm developing an app
I have a task tracking application, which is very basic. It currently has a
I am just getting started using any DI/IoC toolset and have a very basic
I am a very new programmer, I have made a couple basic applications, however
I have some very basic semaphore code that works great on Linux, but cannot
I have a very basic doubt regarding the method that gets executed when app
I have a very basic knowledge of the web programming, and I couldn't figure
I have a very basic data class that is subclassed from NSObject. I declare

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.