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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:35:03+00:00 2026-05-27T04:35:03+00:00

I’m pretty new to c++ and I’m having a problem debugging a linker error.

  • 0

I’m pretty new to c++ and I’m having a problem debugging a linker error. I’m using wxDev-c++ with the g++ compiler. I’ve created a static library which I’m linking to a basic project. The library originally contained no references to external header files or libraries, it was just a couple of simple test functions adding together 2 doubles and returning the value. This worked fine when linked to the test project. However I’m now trying to incorporate FTP into that library and I’m now getting linker errors.

At the moment the test function is just trying to access the same simple addition function for testing, I’m not even calling the FTP functionality yet since I’m just trying to get the test project compiling correctly.

The library code:

DaFTPLib.h:

#ifndef WAVE_H
#define WAVE_H
#ifdef __BORLANDC__
#pragma hdrstop
#endif

#ifndef WX_PRECOMP
#include <wx/wx.h>
#else
#include <wx/wxprec.h>
#endif

#include <wx/protocol/ftp.h>

namespace Wave
{
    class DaFTP
    {
        public:
        DaFTP(char *url, char *login, char *password);
        ~DaFTP();
        const int Download(char* fileName);
        static const void DownloadNCWD(char *url, char *fileName, char *login, char *password);
        static const void DownloadLAMP();
        static double FuncA(double a, double b);
        static double FuncB(double a, double b);

        private:
        char* url, login, password;
        wxFTP ftp;
    };
}

#endif

DaFTP.cpp:

#include "DaFTPLib.h"

using namespace std;
char* _url;
char* _login;
char* _password;
wxFTP ftp;

namespace Wave
{
    DaFTP::DaFTP(char *url, char *login, char *password)
    {
       _url = url;
       _login = login;
       _password = password;
    }

    DaFTP::~DaFTP(){}

    const int DaFTP::Download(char *fileName)
    {
        int fileSize;

        ftp.SetPassive(true);
        ftp.SetUser(_login);
        ftp.SetPassword(_password);
        ftp.Connect(_url);

        fileSize = ftp.GetFileSize(fileName);
        return fileSize;
    }

    const void DaFTP::DownloadNCWD(char *url, char *fileName, char *login, char *password)
    {
        DaFTP daftp(url, login, password);
        daftp.Download(fileName);
    }

    const void DaFTP::DownloadLAMP() {}

    double DaFTP::FuncA(double a, double b)
    {
         return a + b;
    }
    double DaFTP::FuncB(double a, double b)
    {
         return a - b;
    }
}

The test project code:

#include <cstdlib>
#include <iostream>

#include "../libDaFTP/DaFTPLib.h"

using namespace std;

int main(int argc, char *argv[])
{
    double a, b, c;

    a = 23.32;
    b = 26.68;

    c = Wave::DaFTP::FuncA(a, b);
    cout << "FuncA val: " << c << endl;

    c = Wave::DaFTP::FuncB(a, b);
    cout << "FuncB val: " << c << endl;
    system("PAUSE");
    return EXIT_SUCCESS;
}

The compile log output for the library (compiles ok):

Executing make…
mingw32-make.exe -f “Makefile.win” all
g++.exe -c DaFTPLib.cpp -o Objects/MingW/DaFTPLib.o -I”C:/Program Files (x86)/Dev-Cpp/lib/gcc/mingw32/3.4.5/include” -I”C:/Program Files (x86)/Dev-Cpp/include/c++/3.4.5/backward” -I”C:/Program Files (x86)/Dev-Cpp/include/c++/3.4.5/mingw32″ -I”C:/Program Files (x86)/Dev-Cpp/include/c++/3.4.5″ -I”C:/Program Files (x86)/Dev-Cpp/include” -I”C:/Program Files (x86)/Dev-Cpp/” -I”C:/Program Files (x86)/Dev-Cpp/include/common/wx/msw” -I”C:/Program Files (x86)/Dev-Cpp/include/common/wx/generic” -I”C:/Program Files (x86)/Dev-Cpp/include/common/wx/html” -I”C:/Program Files (x86)/Dev-Cpp/include/common/wx/protocol” -I”C:/Program Files (x86)/Dev-Cpp/include/common/wx/xml” -I”C:/Program Files (x86)/Dev-Cpp/include/common/wx/xrc” -I”C:/Program Files (x86)/Dev-Cpp/include/common/wx” -I”C:/Program Files (x86)/Dev-Cpp/include/common”

ar rcu “Output/MingW/libDaFTP.a” “Objects/MingW/DaFTPLib.o”

Execution terminated
Compilation successful
Compilation took 1 second to complete

The compile log output for the test project (compilation fails)

Executing make…
mingw32-make.exe -f “Makefile.win” all
g++.exe -c main.cpp -o Objects/MingW/main.o -I”C:/Program Files (x86)/Dev-Cpp/lib/gcc/mingw32/3.4.5/include” -I”C:/Program Files (x86)/Dev-Cpp/include/c++/3.4.5/backward” -I”C:/Program Files (x86)/Dev-Cpp/include/c++/3.4.5/mingw32″ -I”C:/Program Files (x86)/Dev-Cpp/include/c++/3.4.5″ -I”C:/Program Files (x86)/Dev-Cpp/include” -I”C:/Program Files (x86)/Dev-Cpp/” -I”C:/Program Files (x86)/Dev-Cpp/include/common/wx/msw” -I”C:/Program Files (x86)/Dev-Cpp/include/common/wx/generic” -I”C:/Program Files (x86)/Dev-Cpp/include/common/wx/html” -I”C:/Program Files (x86)/Dev-Cpp/include/common/wx/protocol” -I”C:/Program Files (x86)/Dev-Cpp/include/common/wx/xml” -I”C:/Program Files (x86)/Dev-Cpp/include/common/wx/xrc” -I”C:/Program Files (x86)/Dev-Cpp/include/common/wx” -I”C:/Program Files (x86)/Dev-Cpp/include/common”

g++.exe “Objects/MingW/main.o” -o “Output/MingW/LibTest.exe” -L”C:/Program Files (x86)/Dev-Cpp/Lib” ../libDaFTP/Output/MingW/libDaFTP.a

Objects/MingW/main.o:main.cpp:(.rdata$_ZTV20wxThreadHelperThread[vtable for wxThreadHelperThread]+0xc): undefined reference to wxThread::TestDestroy()'
Objects/MingW/main.o:main.cpp:(.text$_ZN20wxThreadHelperThreadD1Ev[wxThreadHelperThread::~wxThreadHelperThread()]+0x16): undefined reference to
wxThread::~wxThread()’
Objects/MingW/main.o:main.cpp:(.text$_ZN20wxThreadHelperThreadD0Ev[wxThreadHelperThread::~wxThreadHelperThread()]+0x16): undefined reference to wxThread::~wxThread()'
../libDaFTP/Output/MingW/libDaFTP.a(DaFTPLib.o):DaFTPLib.cpp:(.text+0x10): undefined reference to
wxFTP::wxFTP()’
../libDaFTP/Output/MingW/libDaFTP.a(DaFTPLib.o):DaFTPLib.cpp:(.text+0x3e): undefined reference to wxFTP::wxFTP()'
../libDaFTP/Output/MingW/libDaFTP.a(DaFTPLib.o):DaFTPLib.cpp:(.text+0x6c): undefined reference to
wxFTP::~wxFTP()’
../libDaFTP/Output/MingW/libDaFTP.a(DaFTPLib.o):DaFTPLib.cpp:(.text+0x82): undefined reference to wxFTP::~wxFTP()'
../libDaFTP/Output/MingW/libDaFTP.a(DaFTPLib.o):DaFTPLib.cpp:(.text+0x1e3): undefined reference to
wxFTP::Connect(wxString const&)’
../libDaFTP/Output/MingW/libDaFTP.a(DaFTPLib.o):DaFTPLib.cpp:(.text+0x24e): undefined reference to wxFTP::GetFileSize(wxString const&)'
../libDaFTP/Output/MingW/libDaFTP.a(DaFTPLib.o):DaFTPLib.cpp:(.text+0x43f): undefined reference to
wxFTP::wxFTP()’
../libDaFTP/Output/MingW/libDaFTP.a(DaFTPLib.o):DaFTPLib.cpp:(.text+0x45a): undefined reference to wxFTP::~wxFTP()'
../libDaFTP/Output/MingW/libDaFTP.a(DaFTPLib.o):DaFTPLib.cpp:(.text$_ZN8wxStringaSERKS_[wxString::operator=(wxString const&)]+0x14): undefined reference to
wxStringBase::operator=(wxStringBase const&)’
../libDaFTP/Output/MingW/libDaFTP.a(DaFTPLib.o):DaFTPLib.cpp:(.text$_ZN12wxStringBaseC2EPKc[wxStringBase::wxStringBase(char const*)]+0x7): undefined reference to wxStringBase::npos'
../libDaFTP/Output/MingW/libDaFTP.a(DaFTPLib.o):DaFTPLib.cpp:(.text$_ZN12wxStringBaseC2EPKc[wxStringBase::wxStringBase(char const*)]+0x25): undefined reference to
wxStringBase::InitWith(char const*, unsigned int, unsigned int)’
collect2: ld returned 1 exit status

mingw32-make.exe: * [Output/MingW/LibTest.exe] Error 1

Execution terminated
Compilation Failed. Make returned 2


I apologize for the long post but hopefully this is sufficient information for someone to point me in the right direction. I assume the issue lies with incorporating the wx/protocol/ftp library but I was under the assumption that when compiling my library any supporting libraries such as the ftp stuff would be compiled in with it.

  • 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-27T04:35:03+00:00Added an answer on May 27, 2026 at 4:35 am

    but I was under the assumption that when compiling my library any supporting libraries such as the ftp stuff would be compiled in with it.

    What you are saying is only true for dynamically linked libraries: if you build a static library that references other libraries, the application or DLL that links to your static library still has to link to the other libraries. A static library is nothing more than a collection of compiled object code. External functions referenced inside the library code have not been linked in.

    Either make your helper library a DLL and link that to the wx library, or keep it static and link every application that uses your static library to the wx library.

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

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
We're building an app, our first using Rails 3, and we're having to build
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I want use html5's new tag to play a wav file (currently only supported
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am currently running into a problem where an element is coming back from
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We are using XSLT to translate a RIXML file to XML. Our RIXML contains

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.