Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Learning
  3. Qt in Education
  4. How to use Qt to call C++ standard library?

How to use Qt to call C++ standard library?

Scheduled Pinned Locked Moved Qt in Education
6 Posts 4 Posters 9.4k Views
  • 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.
  • X Offline
    X Offline
    xjruan
    wrote on 17 Jan 2011, 03:09 last edited by
    #1

    Hello ,there is a Qt project ,I need to use C++ standard library,I config the .pro file as follows:

    LIBS+=opc/SeyOPC.lib
    .........

    but the compiler give compiling errers like this:
    undefined reference to `SeyOPC::initialize(char const*, char const*)

    Is there anyone knowing how using C++ standard library with Qt?
    if there is ,Please give me some advice ,thanks!
    I'm waiting!

    1 Reply Last reply
    0
    • G Offline
      G Offline
      giesbert
      wrote on 17 Jan 2011, 07:20 last edited by
      #2

      Hi xjruan

      First of all, we need more information:

      which is your platform?
      Do you use QtCreator and which version?
      Which compiler do you use? Mingw?

      What is a C++ standard library? You mean a C++ library that exports pure C++ objects? With which compiler is this lib build?

      Nokia Certified Qt Specialist.
      Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

      1 Reply Last reply
      0
      • X Offline
        X Offline
        xjruan
        wrote on 17 Jan 2011, 07:31 last edited by
        #3

        My platform is win7-64bit, and use QtCreator 2.0 ,Qt version is 4.7.0, the compiler is Mingw;
        The lib is built by Visual Studio 2008 SP1.

        the export method is as below:

        extern "C" __declspec(dllexport) void init(char const*, char const*);

        1 Reply Last reply
        0
        • G Offline
          G Offline
          goetz
          wrote on 17 Jan 2011, 11:37 last edited by
          #4

          You cannot mix C++ libraries built with Visual Studio and MinGW. Google for "name mangling" if you want to learn the reasons.

          You must either build your library with MinGW too or use Visual Studio 2008 SP1 for your project.

          http://www.catb.org/~esr/faqs/smart-questions.html

          1 Reply Last reply
          0
          • J Offline
            J Offline
            jdbastardy
            wrote on 17 Jan 2011, 16:28 last edited by
            #5

            I had the same issue in the past... I was still a beginner and I still remember the days spent on testing Qt on MinGW and VS2005. Nice days. Didn't know about name mangling however.

            http://mattias-cibien.co.cc

            • Prepare for Qt consequences.
            1 Reply Last reply
            0
            • X Offline
              X Offline
              xjruan
              wrote on 18 Jan 2011, 05:29 last edited by
              #6

              Thanks for your help ! I have the the solution by using the QLibrary class!

              1 Reply Last reply
              0

              1/6

              17 Jan 2011, 03:09

              • Login

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