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. Qt Creator and SystemC libraries - 'undefined reference' errors
Forum Updated to NodeBB v4.3 + New Features

Qt Creator and SystemC libraries - 'undefined reference' errors

Scheduled Pinned Locked Moved Unsolved General and Desktop
c++
6 Posts 2 Posters 2.8k Views 1 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.
  • N Offline
    N Offline
    Nilson
    wrote on 30 Nov 2017, 20:06 last edited by
    #1

    Hello. I have a problem with a C++ project which uses some SystemC libraries (however, this project can be built correctly using MS Visual Studio). While trying to build a project, I get tons of 'undefined reference' errors like:

    /home/user111/Desktop/systemc-2.3.2/src/sysc/communication/sc_port.h:465: error: undefined reference to `sc_core::sc_abort()'
    

    Path (/home/user111/.../src) is included using INCLUDEPATH += in .pro file.
    My OS is Linux Mint 18.
    What can I do with it?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 30 Nov 2017, 20:16 last edited by
      #2

      Hi,

      Are you linking your project to that library ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      N 1 Reply Last reply 30 Nov 2017, 21:08
      0
      • S SGaist
        30 Nov 2017, 20:16

        Hi,

        Are you linking your project to that library ?

        N Offline
        N Offline
        Nilson
        wrote on 30 Nov 2017, 21:08 last edited by
        #3

        @SGaist Yes, I am linking my project to that library.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 30 Nov 2017, 21:21 last edited by
          #4

          Can you show the .pro file ?

          Did you check that the library was from the correct architecture ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          N 1 Reply Last reply 30 Nov 2017, 22:07
          0
          • S SGaist
            30 Nov 2017, 21:21

            Can you show the .pro file ?

            Did you check that the library was from the correct architecture ?

            N Offline
            N Offline
            Nilson
            wrote on 30 Nov 2017, 22:07 last edited by
            #5

            @SGaist , this is my .pro file:

            TEMPLATE = app
            CONFIG += console c++11
            CONFIG -= app_bundle
            CONFIG -= qt
            
            
            
            SOURCES += \
                ../myproject/ImpulseGen.cpp \
                ../myproject/ImpulseGenTest.cpp \
                ../myproject/main.cpp
            
            HEADERS += \
                ../myproject/ImpulseGen.h \
                ../myproject/ImpulseGenTest.h
            
            
            
            
            win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../Desktop/systemc-2.3.2/lib-linux/release/ -lsystemc
            else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../Desktop/systemc-2.3.2/lib-linux/debug/ -lsystemc
            else:unix: LIBS += -L$$PWD/../Desktop/systemc-2.3.2/lib-linux/ -lsystemc
            
            INCLUDEPATH += $$PWD/../Desktop/systemc-2.3.2/include
            DEPENDPATH += $$PWD/../Desktop/systemc-2.3.2/include
            
            win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/../Desktop/systemc-2.3.2/lib-linux/release/libsystemc.a
            else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/../Desktop/systemc-2.3.2/lib-linux/debug/libsystemc.a
            else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/../Desktop/systemc-2.3.2/lib-linux/release/systemc.lib
            else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/../Desktop/systemc-2.3.2/lib-linux/debug/systemc.lib
            else:unix: PRE_TARGETDEPS += $$PWD/../Desktop/systemc-2.3.2/lib-linux/libsystemc.a
            
            

            After my first message, I re-built systemc libraries () and included them in my project, but one error still occurs:

            /home/user111/Desktop/systemc-2.3.2/include/sysc/kernel/sc_ver.h:179: error: undefined reference to `sc_core::sc_api_version_2_3_2_cxx201103L<&sc_core::SC_DISABLE_VIRTUAL_BIND_UNDEFINED_>::sc_api_version_2_3_2_cxx201103L(sc_core::sc_writer_policy)'
            

            This error is in "include/sysc/kernel/sc_ver.h" file:

            api_version_check  // error here
            (
              SC_DEFAULT_WRITER_POLICY
            );
            
            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 30 Nov 2017, 22:12 last edited by
              #6

              From the looks of it I would say there's somehow a mismatch with the C++ standard used and this stackoverflow answer goes in the same direction.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              1

              3/6

              30 Nov 2017, 21:08

              • Login

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