Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED] Issue when using class created with my Dll
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Issue when using class created with my Dll

Scheduled Pinned Locked Moved General and Desktop
dll
23 Posts 2 Posters 5.7k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mcosta
    wrote on last edited by
    #6

    Can you post the code and the qmake project file??

    Once your problem is solved don't forget to:

    • Mark the thread as SOLVED using the Topic Tool menu
    • Vote up the answer(s) that helped you to solve the issue

    You can embed images using (http://imgur.com/) or (http://postimage.org/)

    1 Reply Last reply
    0
    • BlackMambaB Offline
      BlackMambaB Offline
      BlackMamba
      wrote on last edited by BlackMamba
      #7

      Well, which code? Obo is around 40k lines of code :/
      Which qMake file? The one from the library?

      Can this be related to EXporting DLL classes? I am not familiar with that at all :(

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mcosta
        wrote on last edited by
        #8

        @BlackMamba said:

        OBOSHARED_EXPORT

        Do you used this also for El?
        The library .pro file should be enough.

        Seems the the El constructor in not available outside the library.

        Once your problem is solved don't forget to:

        • Mark the thread as SOLVED using the Topic Tool menu
        • Vote up the answer(s) that helped you to solve the issue

        You can embed images using (http://imgur.com/) or (http://postimage.org/)

        1 Reply Last reply
        0
        • BlackMambaB Offline
          BlackMambaB Offline
          BlackMamba
          wrote on last edited by
          #9

          I didn't use this for the EI class, let me try that !

          1 Reply Last reply
          0
          • BlackMambaB Offline
            BlackMambaB Offline
            BlackMamba
            wrote on last edited by BlackMamba
            #10

            Now it compiles but crashes immediately when I execute the code.
            Here is the pro file :

            • include(Obo.pri)
              QT -= gui
              TARGET = Obo
              TEMPLATE = lib
              DEFINES += Obo_LIBRARY
              SOURCES += Obo.cpp
              HEADERS += Obo.h
              Obo_global.h
              unix {
              target.path = /usr/lib
              INSTALLS += target
              }

            and the .pri file :

            • SOURCES +=
              ...
              $$PWD/src/OboInterface/EI.cpp
              HEADERS +=
              $$PWD/src/OboInterface/EI.h
              ...
              DEPENDPATH += $$PWD/src/OboInterface
              INCLUDEPATH+= $$PWD/src/OboInterface
            1 Reply Last reply
            0
            • M Offline
              M Offline
              mcosta
              wrote on last edited by
              #11

              Ok,

              where's the crash? which line? Are you able to collect a crash dump?

              Once your problem is solved don't forget to:

              • Mark the thread as SOLVED using the Topic Tool menu
              • Vote up the answer(s) that helped you to solve the issue

              You can embed images using (http://imgur.com/) or (http://postimage.org/)

              1 Reply Last reply
              0
              • BlackMambaB Offline
                BlackMambaB Offline
                BlackMamba
                wrote on last edited by
                #12

                It crashes at the same line, when I try to instantiate the object :
                EI myEI;

                1 Reply Last reply
                0
                • M Offline
                  M Offline
                  mcosta
                  wrote on last edited by mcosta
                  #13

                  How is defined El??

                  Try to provide as much information as possible; otherwise we'll be not able to help you

                  Once your problem is solved don't forget to:

                  • Mark the thread as SOLVED using the Topic Tool menu
                  • Vote up the answer(s) that helped you to solve the issue

                  You can embed images using (http://imgur.com/) or (http://postimage.org/)

                  1 Reply Last reply
                  0
                  • BlackMambaB Offline
                    BlackMambaB Offline
                    BlackMamba
                    wrote on last edited by BlackMamba
                    #14

                    With an empty class, I have the same issue :

                    • #ifndef EI_H
                      #define EI_H

                    class EI
                    {
                    public:
                    EI();
                    ~EI();
                    };

                    #endif // EI_H

                    main.obj:-1: erreur : LNK2019: unresolved external symbol "public: __cdecl EI::EI(void)" (??0EI@@QEAA@XZ) referenced in function main

                    With this :

                    #ifndef EI_H
                    #define EI_H

                    #include "obo_global.h"

                    class OBOSHARED_EXPORT EI
                    {
                    public:
                    EI();
                    ~EI();
                    };

                    #endif // EI_H

                    same error :(

                    1 Reply Last reply
                    0
                    • M Offline
                      M Offline
                      mcosta
                      wrote on last edited by
                      #15

                      I mean the implementation of El.

                      Can you post the crash dump?

                      Once your problem is solved don't forget to:

                      • Mark the thread as SOLVED using the Topic Tool menu
                      • Vote up the answer(s) that helped you to solve the issue

                      You can embed images using (http://imgur.com/) or (http://postimage.org/)

                      BlackMambaB 1 Reply Last reply
                      0
                      • BlackMambaB Offline
                        BlackMambaB Offline
                        BlackMamba
                        wrote on last edited by
                        #16

                        After some clean, good news, I have a new mistake when I add OB0SHARED_EXPORT for the EI class:
                        main.obj:-1: erreur : LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl EI::EI(void)" (_imp??0EI@@QEAA@XZ) referenced in function main

                        1 Reply Last reply
                        0
                        • M mcosta

                          I mean the implementation of El.

                          Can you post the crash dump?

                          BlackMambaB Offline
                          BlackMambaB Offline
                          BlackMamba
                          wrote on last edited by
                          #17

                          @mcosta I gave youi the implementation, I deleted all the methods, its an empty class with ctor and dtor only.

                          1 Reply Last reply
                          0
                          • M Offline
                            M Offline
                            mcosta
                            wrote on last edited by
                            #18

                            Sorry, if you don't show the code I can't help you!

                            Once your problem is solved don't forget to:

                            • Mark the thread as SOLVED using the Topic Tool menu
                            • Vote up the answer(s) that helped you to solve the issue

                            You can embed images using (http://imgur.com/) or (http://postimage.org/)

                            BlackMambaB 1 Reply Last reply
                            0
                            • M mcosta

                              Sorry, if you don't show the code I can't help you!

                              BlackMambaB Offline
                              BlackMambaB Offline
                              BlackMamba
                              wrote on last edited by
                              #19

                              @mcosta Please read my last answer ;)

                              1 Reply Last reply
                              0
                              • M Offline
                                M Offline
                                mcosta
                                wrote on last edited by
                                #20

                                So, now you have the link error or still the crash??

                                You said before you was able to compile and link but you get a crash and now again the link error. It's a little bit confusing

                                Once your problem is solved don't forget to:

                                • Mark the thread as SOLVED using the Topic Tool menu
                                • Vote up the answer(s) that helped you to solve the issue

                                You can embed images using (http://imgur.com/) or (http://postimage.org/)

                                1 Reply Last reply
                                0
                                • BlackMambaB Offline
                                  BlackMambaB Offline
                                  BlackMamba
                                  wrote on last edited by
                                  #21

                                  Now the crash ... Yes, its confusing for me too.
                                  Thats looks so simple, I don't understand what I am doing wrong.
                                  The crash means he cant find the EI cpp implementation at runtime.

                                  1 Reply Last reply
                                  0
                                  • BlackMambaB Offline
                                    BlackMambaB Offline
                                    BlackMamba
                                    wrote on last edited by BlackMamba
                                    #22

                                    OMG!!!!! I am soooooo stupid ... I didn't update the copy of the Obo.dll .....
                                    Sorry for your time mcosta !

                                    You gave me the right answer by adding OB0SHARED_EXPORT for the classes you need to use after ...
                                    Thanks !

                                    1 Reply Last reply
                                    0
                                    • M Offline
                                      M Offline
                                      mcosta
                                      wrote on last edited by
                                      #23

                                      Ok, no problem!

                                      Happy programming

                                      Once your problem is solved don't forget to:

                                      • Mark the thread as SOLVED using the Topic Tool menu
                                      • Vote up the answer(s) that helped you to solve the issue

                                      You can embed images using (http://imgur.com/) or (http://postimage.org/)

                                      1 Reply Last reply
                                      0

                                      • Login

                                      • Login or register to search.
                                      • First post
                                        Last post
                                      0
                                      • Categories
                                      • Recent
                                      • Tags
                                      • Popular
                                      • Users
                                      • Groups
                                      • Search
                                      • Get Qt Extensions
                                      • Unsolved