×

Discussion Board

Results 1 to 10 of 10
  1. #1
    Registered User
    Join Date
    Feb 2012
    Posts
    61

    Multiply defined symbol when running

    I am using gsoap generated classes to make a webservice client. If I include gsoap's .h in the main.cpp no problem, but if I include them in another .cpp I get these errors:


    mwldsym2.exe: Multiply defined symbol: struct Namespace * namespaces (?namespaces@@3PAUNamespace@@A) in
    mwldsym2.exe: files maxintervaltimer.o, main.o
    mwldsym2.exe: Multiply defined symbol: struct Namespace * namespaces (?namespaces@@3PAUNamespace@@A) in
    mwldsym2.exe: files moc_maxintervaltimer.o, main.o

  2. #2
    Registered User
    Join Date
    Sep 2011
    Posts
    449

    Re: Multiply defined symbol when running

    Hi,

    I have not tried this but instructions in this link might help.

    http://developer.qt.nokia.com/forums/viewthread/1553

    Please check the post given on june 21st, 2011.
    This has the information to generate code.

    I guess the problem is this step has not been taken care of -
    • Before usinf wsdl2h you have to modify “typemap.dat” file, this file is present in ‘gsoap/ws’ directory. Add a line in this file defining namespace of your webservice. Give any name to namespace and copy string from your .wsdl file following the tag.
    <definitions targetNamespace=http://something>
    Add this line to “typemap.dat” file
    Anyting =”http://something”.

    Also there is a wiki article at -

    http://www.developer.nokia.com/Commu...r_web_services

  3. #3
    Registered User
    Join Date
    Feb 2012
    Posts
    61

    Re: Multiply defined symbol when running

    Hey kusumk, I've done every step from those instructions and in the end i get the same error :/

    mwldsym2.exe: Multiply defined symbol: struct Namespace * namespaces (?namespaces@@3PAUNamespace@@A) in
    mwldsym2.exe: files moc_maxintervaltimer.o, maxintervaltimer.o

  4. #4
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    3,988

    Re: Multiply defined symbol when running

    paste here maxintervaltimer.cpp & .h

  5. #5
    Registered User
    Join Date
    Feb 2012
    Posts
    61

    Re: Multiply defined symbol when running

    #ifndef MAXINTERVALTIMER_H
    #define MAXINTERVALTIMER_H

    #include <QDebug>
    #include "gsoap/soapAfocelcaSoapProxy.h"
    #include "gsoap/AfocelcaSoap.nsmap"
    #include "configuration.h"
    #include "timerhandler.h"
    #include <list>
    #include <QTimer>
    #include <qsysteminfo.h>

    #define SECONDS_IN_A_DAY 86400

    using namespace std;
    using namespace QtMobility;

    class maxIntervalTimer : public QObject
    {
    Q_OBJECT
    public:
    maxIntervalTimer();
    void timeout();
    void start();
    void stop();
    private:
    QTimer *timer;
    //List of configurations
    list <Configuration> configs;
    list <TimerHandler *> timers;

    //Maximum time that a device is allowed to not contact the server
    int maxInterval;
    //Time interval in which the device will send its state to the server
    int autoInterval;

    void timerTick();
    };

    #endif // MAXINTERVALTIMER_H

    ################################################

    #include "maxintervaltimer.h"

    maxIntervalTimer::maxIntervalTimer()
    {
    timer = new QTimer(this);

    connect(timer, SIGNAL(timeout()), this, SLOT(checkConfig));
    }



    void maxIntervalTimer::timeout()
    {
    qDebug() << " Timer timed out...";
    }

    void maxIntervalTimer::stop()
    {
    timer->stop();
    }

    void maxIntervalTimer::timerTick()
    {
    qDebug() << "MaxIntervalTimer TICKING...";
    }

    void maxIntervalTimer::start()
    {

    timer->start(maxInterval);
    }

  6. #6
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    3,988

    Re: Multiply defined symbol when running

    try commenting this : #include "gsoap/soapAfocelcaSoapProxy.h"

  7. #7
    Registered User
    Join Date
    Feb 2012
    Posts
    61

    Re: Multiply defined symbol when running

    If i comment out the #include "gsoap/AfocelcaSoap.nsmap" and #include "gsoap/soapAfocelcaSoapProxy.h" the error goes away.. but I need this for connecting to the WS.

  8. #8
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    3,988

    Re: Multiply defined symbol when running

    I said only comment : gsoap/soapAfocelcaSoapProxy.h to see if affects as soapproxy.h & .nsmap have the same namespace declaration inside them

  9. #9
    Registered User
    Join Date
    Feb 2012
    Posts
    61

    Re: Multiply defined symbol when running

    Still getting that nasty error by commenting only that header

  10. #10
    Registered User
    Join Date
    Feb 2012
    Posts
    61

    Re: Multiply defined symbol when running

    removed #include "gsoap/AfocelcaSoap.nsmap" and it works thanks for the help!

Similar Threads

  1. Replies: 1
    Last Post: 2010-09-09, 11:34
  2. multiply defined section
    By mukesh_r_solanki in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 4
    Last Post: 2008-07-17, 09:19
  3. Multiply defined symbol
    By chandrasekharan in forum Symbian
    Replies: 4
    Last Post: 2007-11-13, 10:25
  4. Multiply Defined section
    By kalyanich in forum Symbian User Interface
    Replies: 4
    Last Post: 2007-05-29, 08:20

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×