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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T00:53:46+00:00 2026-05-20T00:53:46+00:00

I’ve got the following situation in my current project: collect2: Id returned 1 exit

  • 0

I’ve got the following situation in my current project: “collect2: Id returned 1 exit status” returned by the compiler using the following code:

#ifndef BASE_02_H
#define BASE_02_H

#include <QtCore>

class Base_02
{

public:
    Base_02();

    virtual void method()=0;
};

#endif // BASE_02_H

#include "base_02.h"
#include <QtCore>

Base_02::Base_02()
{

}

//----------------------------------------------------------------------------------------------------------------------------------

#ifndef DERIVED_02_H
#define DERIVED_02_H

#include <QtCore>
#include "base_02.h"

class Derived_02 : public Base_02
{

public:
    Derived_02();
    void method();
};

#endif // DERIVED_02_H

#include "derived_02.h"
#include <QtCore>

Derived_02::Derived_02()
{

}

void Derived_02::method()
{
    qDebug() << "Derived_02::method()";
}

//----------------------------------------------------------------------------------------------------------------------------------

#ifndef BASE_H
#define BASE_H

#include <QtCore>

class Base : public QObject
{
    Q_OBJECT

public:
    Base(Base* p=NULL);

    virtual void method()=0;
};

#endif // BASE_H

#include "base.h"
#include <QtCore>

Base::Base(Base* p)
{

}

//----------------------------------------------------------------------------------------------------------------------------------

#ifndef DERIVED_H
#define DERIVED_H

#include <QtCore>
#include "base.h"

class Derived : public Base
{
    Q_OBJECT

public:
    Derived(Derived* p=NULL);
    void method();
};

#endif // DERIVED_H

#include "derived.h"
#include "derived_02.h"
#include <QtCore>

Derived::Derived(Derived* p)
{

}

void Derived::method()
{
    Derived_02 d;
    d.method();
}

//----------------------------------------------------------------------------------------------------------------------------------

#include <QtCore/QCoreApplication>
#include <QtCore>
#include "base.h"
#include "derived.h"

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



    Derived* derived = new Derived();



    return a.exec();
}

The compiler says the following:

…
mingw32-make: Entering directory C:/Entwicklung SVN/debug test/dataSenderReceiverExample'
C:/Qt/2010.04/mingw/bin/mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory
C:/Entwicklung SVN/debug test/dataSenderReceiverExample’
g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_CORE_LIB -DQT_THREAD_SUPPORT -I”……\Qt\2010.04\qt\include\QtCore” -I”……\Qt\2010.04\qt\include” -I”..\dataSenderReceiver” -I”……\Qt\2010.04\qt\include\ActiveQt” -I”debug” -I”……\Qt\2010.04\qt\mkspecs\win32-g++” -o debug\main.o main.cpp
main.cpp: In function ‘int main(int, char**)’:
main.cpp:14: warning: unused variable ‘derived’
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -Wl,-subsystem,console -mthreads -Wl -o debug\dataSenderReceiverExample.exe debug/main.o -L”c:\Qt\2010.04\qt\lib” -L../dataSenderReceiver/debug -ldataSenderReceiver -lQtCored4
mingw32-make[1]: Leaving directory C:/Entwicklung SVN/debug test/dataSenderReceiverExample'
mingw32-make: Leaving directory
C:/Entwicklung SVN/debug test/dataSenderReceiverExample’
../dataSenderReceiver/debug/libdataSenderReceiver.a(derived.o):C:\Entwicklung SVN\debug test\dataSenderReceiver/derived.cpp:14: undefined reference to Derived_02::Derived_02()'
../dataSenderReceiver/debug/libdataSenderReceiver.a(derived.o):C:\Entwicklung SVN\debug test\dataSenderReceiver/derived.cpp:15: undefined reference to
Derived_02::method()’
collect2: ld returned 1 exit status
mingw32-make[1]: * [debug\dataSenderReceiverExample.exe] Error 1
mingw32-make: *
[debug] Error 2
The Prozess “C:/Qt/2010.04/mingw/bin/mingw32-make.exe” wurde mit dem Rückgabewert %2 beendet.
Fehler beim Erstellen des Projekts dataSenderReceiverExample (Ziel: Desktop)
Beim Ausführen des Build-Schritts ‘Make’

Please help!

  • 1 1 Answer
  • 1 View
  • 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-20T00:53:47+00:00Added an answer on May 20, 2026 at 12:53 am
    #include "base_02.h"
    #include <QtCore>
    

    has to be:

    #include <QtCore>
    #include "base_02.h"
    

    Then it compiles!

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

Sidebar

Related Questions

I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I've got a string that has curly quotes in it. I'd like to replace
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build

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.