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. :-1: error: symbol(s) not found for architecture x86_64

:-1: error: symbol(s) not found for architecture x86_64

Scheduled Pinned Locked Moved Unsolved General and Desktop
42 Posts 6 Posters 14.9k Views 3 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.
  • jsulmJ jsulm

    @Dhara Can you post the whole build log?

    D Offline
    D Offline
    Dhara
    wrote on last edited by
    #24

    @jsulm sure: here it is:

    16:15:24: Running steps for project QTSubDirs...
    16:15:24: Configuration unchanged, skipping qmake step.
    16:15:24: Starting: "/usr/bin/make" 
    cd QTConsoleApp/ && ( test -e Makefile || /Users/user1/Qt5.9.0/5.9/clang_64/bin/qmake -o Makefile /Users/user1/Documents/QTSubDirs/QTConsoleApp/QTConsoleApp.pro -spec macx-clang CONFIG+=debug CONFIG+=x86_64 CONFIG+=qml_debug ) && /Applications/Xcode.app/Contents/Developer/usr/bin/make -f Makefile 
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -pipe -stdlib=libc++ -g -std=gnu++11  -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -mmacosx-version-min=10.12 -Wall -W -fPIC -DQT_DEPRECATED_WARNINGS -DQTCONSOLEAPP_LIBRARY -DQT_QML_DEBUG -DQT_CORE_LIB -I../../QTSubDirs/QTConsoleApp -I. -I../../../Qt5.9.0/5.9/clang_64/lib/QtCore.framework/Headers -I. -I../../../Qt5.9.0/5.9/clang_64/mkspecs/macx-clang -F/Users/user1/Qt5.9.0/5.9/clang_64/lib -o main.o ../../QTSubDirs/QTConsoleApp/main.cpp
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -pipe -stdlib=libc++ -g -std=gnu++11  -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -mmacosx-version-min=10.12 -Wall -W -fPIC -DQT_DEPRECATED_WARNINGS -DQTCONSOLEAPP_LIBRARY -DQT_QML_DEBUG -DQT_CORE_LIB -I../../QTSubDirs/QTConsoleApp -I. -I../../../Qt5.9.0/5.9/clang_64/lib/QtCore.framework/Headers -I. -I../../../Qt5.9.0/5.9/clang_64/mkspecs/macx-clang -F/Users/user1/Qt5.9.0/5.9/clang_64/lib -o contact.o ../../QTSubDirs/QTConsoleApp/contact.cpp
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -pipe -stdlib=libc++ -g -std=gnu++11  -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -mmacosx-version-min=10.12 -Wall -W -fPIC -DQT_DEPRECATED_WARNINGS -DQTCONSOLEAPP_LIBRARY -DQT_QML_DEBUG -DQT_CORE_LIB -I../../QTSubDirs/QTConsoleApp -I. -I../../../Qt5.9.0/5.9/clang_64/lib/QtCore.framework/Headers -I. -I../../../Qt5.9.0/5.9/clang_64/mkspecs/macx-clang -F/Users/user1/Qt5.9.0/5.9/clang_64/lib -o user.o ../../QTSubDirs/QTConsoleApp/user.cpp
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -pipe -stdlib=libc++ -g -std=gnu++11  -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -mmacosx-version-min=10.12 -Wall -W -fPIC -DQT_DEPRECATED_WARNINGS -DQTCONSOLEAPP_LIBRARY -DQT_QML_DEBUG -DQT_CORE_LIB -I../../QTSubDirs/QTConsoleApp -I. -I../../../Qt5.9.0/5.9/clang_64/lib/QtCore.framework/Headers -I. -I../../../Qt5.9.0/5.9/clang_64/mkspecs/macx-clang -F/Users/user1/Qt5.9.0/5.9/clang_64/lib -o group.o ../../QTSubDirs/QTConsoleApp/group.cpp
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -stdlib=libc++ -headerpad_max_install_names  -arch x86_64 -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -mmacosx-version-min=10.12 -Wl,-rpath,@executable_path/Frameworks -Wl,-rpath,/Users/user1/Qt5.9.0/5.9/clang_64/lib -o QTConsoleApp main.o contact.o user.o group.o   -F/Users/user1/Qt5.9.0/5.9/clang_64/lib -framework QtCore -framework DiskArbitration -framework IOKit 
    cd Test/ && ( test -e Makefile || /Users/user1/Qt5.9.0/5.9/clang_64/bin/qmake -o Makefile /Users/user1/Documents/QTSubDirs/Test/Test.pro -spec macx-clang CONFIG+=debug CONFIG+=x86_64 CONFIG+=qml_debug ) && /Applications/Xcode.app/Contents/Developer/usr/bin/make -f Makefile 
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -pipe -stdlib=libc++ -g -std=gnu++11  -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -mmacosx-version-min=10.12 -Wall -W -dM -E -o moc_predefs.h ../../../Qt5.9.0/5.9/clang_64/mkspecs/features/data/dummy.cpp
    /Users/user1/Qt5.9.0/5.9/clang_64/bin/moc -DQT_DEPRECATED_WARNINGS -DSRCDIR=\"/Users/user1/Documents/QTSubDirs/Test/\" -DQT_QML_DEBUG -DQT_TESTLIB_LIB -DQT_CORE_LIB -DQT_TESTCASE_BUILDDIR='"/Users/user1/Documents/build-QTSubDirs-Desktop_Qt_5_9_0_clang_64bit-Debug/Test"' --include ./moc_predefs.h -I/Users/user1/Qt5.9.0/5.9/clang_64/mkspecs/macx-clang -I/Users/user1/Documents/QTSubDirs/Test -I/Users/user1/Qt5.9.0/5.9/clang_64/lib/QtTest.framework/Headers -I/Users/user1/Qt5.9.0/5.9/clang_64/lib/QtCore.framework/Headers -I. -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1 -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/8.1.0/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include -F/Users/user1/Qt5.9.0/5.9/clang_64/lib ../../QTSubDirs/Test/test_user.cc -o test_user.moc
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -pipe -stdlib=libc++ -g -std=gnu++11  -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -mmacosx-version-min=10.12 -Wall -W -fPIC -DQT_DEPRECATED_WARNINGS -DSRCDIR=\"/Users/user1/Documents/QTSubDirs/Test/\" -DQT_QML_DEBUG -DQT_TESTLIB_LIB -DQT_CORE_LIB -DQT_TESTCASE_BUILDDIR='"/Users/user1/Documents/build-QTSubDirs-Desktop_Qt_5_9_0_clang_64bit-Debug/Test"' -I../../QTSubDirs/Test -I. -I../../../Qt5.9.0/5.9/clang_64/lib/QtTest.framework/Headers -I../../../Qt5.9.0/5.9/clang_64/lib/QtCore.framework/Headers -I. -I../../../Qt5.9.0/5.9/clang_64/mkspecs/macx-clang -F/Users/user1/Qt5.9.0/5.9/clang_64/lib -o test_user.o ../../QTSubDirs/Test/test_user.cc
    /Users/user1/Qt5.9.0/5.9/clang_64/bin/moc -DQT_DEPRECATED_WARNINGS -DSRCDIR=\"/Users/user1/Documents/QTSubDirs/Test/\" -DQT_QML_DEBUG -DQT_TESTLIB_LIB -DQT_CORE_LIB -DQT_TESTCASE_BUILDDIR='"/Users/user1/Documents/build-QTSubDirs-Desktop_Qt_5_9_0_clang_64bit-Debug/Test"' --include ./moc_predefs.h -I/Users/user1/Qt5.9.0/5.9/clang_64/mkspecs/macx-clang -I/Users/user1/Documents/QTSubDirs/Test -I/Users/user1/Qt5.9.0/5.9/clang_64/lib/QtTest.framework/Headers -I/Users/user1/Qt5.9.0/5.9/clang_64/lib/QtCore.framework/Headers -I. -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1 -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/8.1.0/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include -F/Users/user1/Qt5.9.0/5.9/clang_64/lib ../../QTSubDirs/Test/test_group.cc -o test_group.moc
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -pipe -stdlib=libc++ -g -std=gnu++11  -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -mmacosx-version-min=10.12 -Wall -W -fPIC -DQT_DEPRECATED_WARNINGS -DSRCDIR=\"/Users/user1/Documents/QTSubDirs/Test/\" -DQT_QML_DEBUG -DQT_TESTLIB_LIB -DQT_CORE_LIB -DQT_TESTCASE_BUILDDIR='"/Users/user1/Documents/build-QTSubDirs-Desktop_Qt_5_9_0_clang_64bit-Debug/Test"' -I../../QTSubDirs/Test -I. -I../../../Qt5.9.0/5.9/clang_64/lib/QtTest.framework/Headers -I../../../Qt5.9.0/5.9/clang_64/lib/QtCore.framework/Headers -I. -I../../../Qt5.9.0/5.9/clang_64/mkspecs/macx-clang -F/Users/user1/Qt5.9.0/5.9/clang_64/lib -o test_group.o ../../QTSubDirs/Test/test_group.cc
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -pipe -stdlib=libc++ -g -std=gnu++11  -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -mmacosx-version-min=10.12 -Wall -W -fPIC -DQT_DEPRECATED_WARNINGS -DSRCDIR=\"/Users/user1/Documents/QTSubDirs/Test/\" -DQT_QML_DEBUG -DQT_TESTLIB_LIB -DQT_CORE_LIB -DQT_TESTCASE_BUILDDIR='"/Users/user1/Documents/build-QTSubDirs-Desktop_Qt_5_9_0_clang_64bit-Debug/Test"' -I../../QTSubDirs/Test -I. -I../../../Qt5.9.0/5.9/clang_64/lib/QtTest.framework/Headers -I../../../Qt5.9.0/5.9/clang_64/lib/QtCore.framework/Headers -I. -I../../../Qt5.9.0/5.9/clang_64/mkspecs/macx-clang -F/Users/user1/Qt5.9.0/5.9/clang_64/lib -o contact.o ../../QTSubDirs/QTConsoleApp/contact.cpp
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -pipe -stdlib=libc++ -g -std=gnu++11  -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -mmacosx-version-min=10.12 -Wall -W -fPIC -DQT_DEPRECATED_WARNINGS -DSRCDIR=\"/Users/user1/Documents/QTSubDirs/Test/\" -DQT_QML_DEBUG -DQT_TESTLIB_LIB -DQT_CORE_LIB -DQT_TESTCASE_BUILDDIR='"/Users/user1/Documents/build-QTSubDirs-Desktop_Qt_5_9_0_clang_64bit-Debug/Test"' -I../../QTSubDirs/Test -I. -I../../../Qt5.9.0/5.9/clang_64/lib/QtTest.framework/Headers -I../../../Qt5.9.0/5.9/clang_64/lib/QtCore.framework/Headers -I. -I../../../Qt5.9.0/5.9/clang_64/mkspecs/macx-clang -F/Users/user1/Qt5.9.0/5.9/clang_64/lib -o user.o ../../QTSubDirs/QTConsoleApp/user.cpp
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -pipe -stdlib=libc++ -g -std=gnu++11  -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -mmacosx-version-min=10.12 -Wall -W -fPIC -DQT_DEPRECATED_WARNINGS -DSRCDIR=\"/Users/user1/Documents/QTSubDirs/Test/\" -DQT_QML_DEBUG -DQT_TESTLIB_LIB -DQT_CORE_LIB -DQT_TESTCASE_BUILDDIR='"/Users/user1/Documents/build-QTSubDirs-Desktop_Qt_5_9_0_clang_64bit-Debug/Test"' -I../../QTSubDirs/Test -I. -I../../../Qt5.9.0/5.9/clang_64/lib/QtTest.framework/Headers -I../../../Qt5.9.0/5.9/clang_64/lib/QtCore.framework/Headers -I. -I../../../Qt5.9.0/5.9/clang_64/mkspecs/macx-clang -F/Users/user1/Qt5.9.0/5.9/clang_64/lib -o group.o ../../QTSubDirs/QTConsoleApp/group.cpp
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -stdlib=libc++ -headerpad_max_install_names  -arch x86_64 -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -mmacosx-version-min=10.12 -Wl,-rpath,@executable_path/Frameworks -Wl,-rpath,/Users/user1/Qt5.9.0/5.9/clang_64/lib -o test_user test_user.o test_group.o contact.o user.o group.o   -F/Users/user1/Qt5.9.0/5.9/clang_64/lib -framework QtTest -framework Security -framework Foundation -framework ApplicationServices -framework IOKit -framework QtCore -framework DiskArbitration 
    Undefined symbols for architecture x86_64:
      "bool QTest::qCompare<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, char [11]>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, char const (&) [11], char const*, char const*, char const*, int)", referenced from:
          TestGroup::copyOfGroupSharesName1() in test_group.o
          TestGroup::contactFromGroupSharesName1() in test_group.o
          TestGroup::contactFromGroupSharesName2() in test_group.o
      "bool QTest::qCompare<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, char [1]>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, char const (&) [1], char const*, char const*, char const*, int)", referenced from:
          TestUser::nullUserUriIsEmpty() in test_user.o
          TestUser::nullUserNameIsEmpty() in test_user.o
          TestUser::initialNameForNamelessUserIsEmpty() in test_user.o
          TestUser::cannotSetNullUserName() in test_user.o
          TestGroup::nullGroupUriIsEmpty() in test_group.o
          TestGroup::nullGroupNameIsEmpty() in test_group.o
          TestGroup::initialNameForNamelessGroupIsEmpty() in test_group.o
          ...
      "bool QTest::qCompare<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, char [20]>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, char const (&) [20], char const*, char const*, char const*, int)", referenced from:
          TestUser::canInitUriWithCtorForNamedUser() in test_user.o
      "bool QTest::qCompare<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, char [22]>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, char const (&) [22], char const*, char const*, char const*, int)", referenced from:
          TestUser::canInitUriWithCtorForeNamelessUser() in test_user.o
          TestUser::copyOfUserHasSameUri() in test_user.o
          TestUser::contactFromUserHasSameUri() in test_user.o
      "bool QTest::qCompare<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, char [23]>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, char const (&) [23], char const*, char const*, char const*, int)", referenced from:
          TestGroup::canInitUriWithCtorForeNamelessGroup() in test_group.o
          TestGroup::canInitUriWithCtorForNamedGroup() in test_group.o
          TestGroup::copyOfGroupHasSameUri() in test_group.o
          TestGroup::contactFromGroupHasSameUri() in test_group.o
      "bool QTest::qCompare<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, char [4]>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, char const (&) [4], char const*, char const*, char const*, int)", referenced from:
          TestUser::canInitNameWithCtor() in test_user.o
          TestUser::copyOfUserHasSameName() in test_user.o
          TestUser::contactFromUserHasSameName() in test_user.o
      "bool QTest::qCompare<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, char [6]>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, char const (&) [6], char const*, char const*, char const*, int)", referenced from:
          TestUser::canChangeUserNameIfWasUnset() in test_user.o
      "bool QTest::qCompare<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, char [7]>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, char const (&) [7], char const*, char const*, char const*, int)", referenced from:
          TestUser::canChangeUserNameIfWasSet() in test_user.o
          TestUser::copyOfUserSharesName1() in test_user.o
          TestUser::copyOfUserSharesName2() in test_user.o
          TestUser::contactFromUserSharesName1() in test_user.o
          TestUser::contactFromUserSharesName2() in test_user.o
          TestGroup::canInitNameWithCtor() in test_group.o
          TestGroup::canChangeGroupNameIfWasUnset() in test_group.o
          ...
      "contact::name()", referenced from:
          TestUser::nullUserNameIsEmpty() in test_user.o
          TestUser::canInitNameWithCtor() in test_user.o
          TestUser::initialNameForNamelessUserIsEmpty() in test_user.o
          TestUser::cannotSetNullUserName() in test_user.o
          TestUser::canChangeUserNameIfWasUnset() in test_user.o
          TestUser::canChangeUserNameIfWasSet() in test_user.o
          TestUser::copyOfUserHasSameName() in test_user.o
          ...
      "contact::setUri(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)", referenced from:
          user::user(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) in test_user.o
          user::user(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) in test_user.o
          user::user(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) in test_group.o
          user::user(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) in test_group.o
      "contact::setName(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)", referenced from:
          TestUser::cannotSetNullUserName() in test_user.o
          TestUser::canChangeUserNameIfWasUnset() in test_user.o
          TestUser::canChangeUserNameIfWasSet() in test_user.o
          TestUser::copyOfUserSharesName1() in test_user.o
          TestUser::copyOfUserSharesName2() in test_user.o
          TestUser::contactFromUserSharesName1() in test_user.o
          TestUser::contactFromUserSharesName2() in test_user.o
          ...
    ld: symbol(s) not found for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    make[1]: *** [test_user] Error 1
    make: *** [sub-Test-make_first] Error 2
    16:15:35: The process "/usr/bin/make" exited with code 2.
    Error while building/deploying project QTSubDirs (kit: Desktop Qt 5.9.0 clang 64bit)
    When executing step "Make"
    16:15:35: Elapsed time: 00:11.
    
    
    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #25

      Try removing CONFIG += c++11 (it is now enabled by default since Qt 5.7) and do a full re-build.

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

      D 1 Reply Last reply
      0
      • SGaistS SGaist

        Try removing CONFIG += c++11 (it is now enabled by default since Qt 5.7) and do a full re-build.

        D Offline
        D Offline
        Dhara
        wrote on last edited by
        #26

        @SGaist said in :-1: error: symbol(s) not found for architecture x86_64:

        CONFIG += c++11

        I removed the same and built the whole project after a clean but i still face the same issue. Is it necessary that my cpp files should extend QObject ?

        jsulmJ V 2 Replies Last reply
        0
        • D Dhara

          @SGaist said in :-1: error: symbol(s) not found for architecture x86_64:

          CONFIG += c++11

          I removed the same and built the whole project after a clean but i still face the same issue. Is it necessary that my cpp files should extend QObject ?

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #27

          @Dhara I don't know whether it is related, but why do you have these lines in your pro file:

          stdlib -=libc++
          stdlib -=libstdc++
          

          You should try a simple project with unit tests to be sure it is working in general.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          D 1 Reply Last reply
          0
          • jsulmJ jsulm

            @Dhara I don't know whether it is related, but why do you have these lines in your pro file:

            stdlib -=libc++
            stdlib -=libstdc++
            

            You should try a simple project with unit tests to be sure it is working in general.

            D Offline
            D Offline
            Dhara
            wrote on last edited by
            #28

            @jsulm @SGaist The issue was with diff arguments being passed. I cannot modify the test case which passes char * to QCOMPARE, but i dont know how to make a char * value be returned from a function using a string*, in other words i would like to convert string * to char * and without the const issues. How should i do that ?

            jsulmJ 1 Reply Last reply
            0
            • D Dhara

              @jsulm @SGaist The issue was with diff arguments being passed. I cannot modify the test case which passes char * to QCOMPARE, but i dont know how to make a char * value be returned from a function using a string*, in other words i would like to convert string * to char * and without the const issues. How should i do that ?

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #29

              @Dhara you could do

              QCOMPARE(u.uri(), string());
              

              then you compare two strings

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              D 1 Reply Last reply
              0
              • jsulmJ jsulm

                @Dhara you could do

                QCOMPARE(u.uri(), string());
                

                then you compare two strings

                D Offline
                D Offline
                Dhara
                wrote on last edited by
                #30

                @jsulm Yes, but this would touch the unit test, i have been given conditions not to change the unit test.

                jsulmJ 1 Reply Last reply
                0
                • D Dhara

                  @jsulm Yes, but this would touch the unit test, i have been given conditions not to change the unit test.

                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by
                  #31

                  @Dhara I don't know your requirements, but actually tests should be adapted to production code not other way around.
                  Alternative would be to return char* instead of a string, but I never would do this just because unit tests would like to have it this way.

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  D 1 Reply Last reply
                  0
                  • jsulmJ jsulm

                    @Dhara I don't know your requirements, but actually tests should be adapted to production code not other way around.
                    Alternative would be to return char* instead of a string, but I never would do this just because unit tests would like to have it this way.

                    D Offline
                    D Offline
                    Dhara
                    wrote on last edited by
                    #32

                    @jsulm your point is true, but what about the TDD approach ?

                    D 1 Reply Last reply
                    0
                    • D Dhara

                      @jsulm your point is true, but what about the TDD approach ?

                      D Offline
                      D Offline
                      Dhara
                      wrote on last edited by
                      #33

                      @jsulm : another question if you could assist please, i get this error now :

                      duplicate symbol _main in:
                          test_user.o
                          test_group.o
                      
                      mrjjM 1 Reply Last reply
                      0
                      • D Dhara

                        @jsulm : another question if you could assist please, i get this error now :

                        duplicate symbol _main in:
                            test_user.o
                            test_group.o
                        
                        mrjjM Offline
                        mrjjM Offline
                        mrjj
                        Lifetime Qt Champion
                        wrote on last edited by
                        #34

                        @Dhara said in :-1: error: symbol(s) not found for architecture x86_64:

                        _main

                        it means that what ever _main is, its include in both
                        test_user and test_group

                        This often happens if its a variable and its define in .h file.

                        So what is _main ?
                        function / variable ?

                        D 1 Reply Last reply
                        1
                        • mrjjM mrjj

                          @Dhara said in :-1: error: symbol(s) not found for architecture x86_64:

                          _main

                          it means that what ever _main is, its include in both
                          test_user and test_group

                          This often happens if its a variable and its define in .h file.

                          So what is _main ?
                          function / variable ?

                          D Offline
                          D Offline
                          Dhara
                          wrote on last edited by
                          #35

                          @mrjj there is no variable named _main or even a function named that. i do have one main.cpp file.

                          mrjjM 1 Reply Last reply
                          0
                          • D Dhara

                            @mrjj there is no variable named _main or even a function named that. i do have one main.cpp file.

                            mrjjM Offline
                            mrjjM Offline
                            mrjj
                            Lifetime Qt Champion
                            wrote on last edited by
                            #36

                            @Dhara
                            Did you move the main function or anything like that?
                            Try to delete the build folder and run qmake+build all.
                            Just to be sure all .o is created fresh.

                            1 Reply Last reply
                            0
                            • SGaistS Offline
                              SGaistS Offline
                              SGaist
                              Lifetime Qt Champion
                              wrote on last edited by
                              #37

                              There's no such restriction in TDD.

                              In TDD, the goal is to have your code tested all along, not that the tests are written in stones and that you should workaround them in your production code.

                              If a function needs to have its signature changed, then update the test so you can validate the new version of that function.

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

                              D 2 Replies Last reply
                              2
                              • SGaistS SGaist

                                There's no such restriction in TDD.

                                In TDD, the goal is to have your code tested all along, not that the tests are written in stones and that you should workaround them in your production code.

                                If a function needs to have its signature changed, then update the test so you can validate the new version of that function.

                                D Offline
                                D Offline
                                Dhara
                                wrote on last edited by
                                #38

                                @SGaist , @jsulm i updated my test cases and still trying to fix other issues.
                                @mrjj : i have updated my code , let's see if i get the same error again :(

                                1 Reply Last reply
                                0
                                • SGaistS SGaist

                                  There's no such restriction in TDD.

                                  In TDD, the goal is to have your code tested all along, not that the tests are written in stones and that you should workaround them in your production code.

                                  If a function needs to have its signature changed, then update the test so you can validate the new version of that function.

                                  D Offline
                                  D Offline
                                  Dhara
                                  wrote on last edited by
                                  #39

                                  @SGaist @jsulm @mrjj :

                                  I now get :

                                  Undefined symbols for architecture x86_64:
                                    "contact::setName(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)", referenced from:
                                        group::group(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) in group.o
                                  

                                  Any suggestions?

                                  1 Reply Last reply
                                  0
                                  • D Dhara

                                    Hi

                                    I am quite new to QT. I have created a subdirs project that has the main app part and also test unit project in it. However when i build the whole project i get errors of the kinds below:

                                    Undefined symbols for architecture x86_64:
                                      "user::setStatus(user::Status)", referenced from:
                                          TestUser::cannotSetNullUserStatus() in test_user.o
                                          TestUser::canChangeUserStatusToOffline() in test_user.o
                                          TestUser::canChangeUserStatusToOnline() in test_user.o
                                          TestUser::copyOfUserSharesStatus1() in test_user.o
                                          TestUser::copyOfUserSharedStatus2() in test_user.o
                                      "user::operator=(user const&)", referenced from:
                                          void std::__1::list<user, std::__1::allocator<user> >::assign<user const*>(user const*, user const*, std::__1::enable_if<__is_input_iterator<user const*>::value, void>::type*) in test_group.o
                                          void std::__1::list<user, std::__1::allocator<user> >::assign<std::__1::__list_const_iterator<user, void*> >(std::__1::__list_const_iterator<user, void*>, std::__1::__list_const_iterator<user, void*>, std::__1::enable_if<__is_input_iterator<std::__1::__list_const_iterator<user, void*> >::value, void>::type*) in test_group.o
                                      "bool QTest::qCompare<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, char [11]>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, char const (&) [11], char const*, char const*, char const*, int)", referenced from:
                                          TestGroup::copyOfGroupSharesName1() in test_group.o
                                          TestGroup::contactFromGroupSharesName1() in test_group.o
                                          TestGroup::contactFromGroupSharesName2() in test_group.o```
                                    
                                    Can anyone please guide me where i am wrong? I can share in the cpp code file too:
                                    

                                    user::Status& user::setStatus(user::Status status) {
                                    if (!isNull()) {
                                    userStatus = new user::Status;
                                    *userStatus = status;
                                    }
                                    return *userStatus;
                                    }

                                    
                                    The header file has this method declaration too. I need to somehow finish this soon, and i tried googling but i dont understand what i should do.
                                    
                                    Please help.
                                    D Offline
                                    D Offline
                                    Dhara
                                    wrote on last edited by Dhara
                                    #40

                                    @jsulm @SGaist @mrjj :

                                    Thanks alot for the help that you have been giving me. I managed to fix all the issues and also the duplicate error meant that i had to create two subprojects for both the test cases, i have no clue what was repeating but doing this solved the issue.

                                    I updated the test cases too so that they would match QCOMPARE's definition.

                                    I also deleted std -= libc++ and the other line and also removed C++11 config line too. Removing these lines did not harm the project.

                                    1 Reply Last reply
                                    1
                                    • Pradeep KumarP Offline
                                      Pradeep KumarP Offline
                                      Pradeep Kumar
                                      wrote on last edited by Pradeep Kumar
                                      #41

                                      Hi,

                                      @Dhara
                                      please move it solved state if u have the got solution and post ur solution so others will be helped from ur answer.

                                      Thanks,

                                      Pradeep Kumar
                                      Qt,QML Developer

                                      1 Reply Last reply
                                      0
                                      • D Dhara

                                        @SGaist said in :-1: error: symbol(s) not found for architecture x86_64:

                                        CONFIG += c++11

                                        I removed the same and built the whole project after a clean but i still face the same issue. Is it necessary that my cpp files should extend QObject ?

                                        V Offline
                                        V Offline
                                        vineesh_tp
                                        wrote on last edited by
                                        #42

                                        @Dhara same issue exist for me too

                                        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