Skip to content
QtWS25 Call for Papers
  • 0 Votes
    47 Posts
    3k Views
    J

    @JonB

    Last edit my code :

    DataReceiver::DataReceiver(QObject *parent) : QObject{parent} { _manager.setAutoDeleteReplies(true); } void DataReceiver::start() { _connection++; if(_connection > 1) return; _takeData = true; run(); } void DataReceiver::stop() { _takeData = false; _connection = 0; _data.clear(); } void DataReceiver::getData() { _data.clear(); QString url = QString("http://localhost:%1/sample").arg(_port); QUrl _apiUrl(url); QNetworkRequest _request(_apiUrl); _reply = _manager.get(_request); connect(_reply, &QNetworkReply::readyRead, this, &DataReceiver::onReadReady); connect(_reply, &QNetworkReply::finished, this, &DataReceiver::onFinished); } void DataReceiver::run() { if(!_takeData) return; getData(); } void DataReceiver::onReadReady() { _data += _reply->readAll(); } void DataReceiver::onFinished() { emit sendData(_data); run(); }

    its working. time slow down from 65ms to 165ms but its working.

  • 0 Votes
    2 Posts
    207 Views
    jsulmJ

    @MarLo Für Raspi brauchst du einen Cross-Compiler.
    Hast du einen installiert?

  • 0 Votes
    3 Posts
    380 Views
    J

    @JonB If you mean ClangCodeModel plugin, no. I deselected that.

  • 0 Votes
    3 Posts
    678 Views
    D

    :( but thanks for the links.

  • 0 Votes
    2 Posts
    1k Views
    K

    @Lior

    Hi and welcome to devnet forum

    Do you have a cross-compiler for cross-compilation on windows for linux? There are certainly cross-compilers available. You would have to cross-compile Qt libs with that cross-compiler. After this you can use the cross-compile toolchain and do a cross-compilation for your applications.

    My personal recommendation is to use virtual machine e.g. VirtualBox and setup the linux environment. Use Qt creator on linux and on windows. You will have the same look and feel in both environments. That is how I do my developments. All is done on windows. However, targeting linux desktop and embedded linux I do the compilation on linux desktop. The reason is lesser pain.

  • 0 Votes
    4 Posts
    4k Views
    mrjjM

    @tansgumus
    ah, so the [] part was left and
    it missed the actual body ? ( {})
    Well these things happens :)

  • 0 Votes
    6 Posts
    2k Views
    JKSHJ

    @A123 said in New Errors when moving C++ code to QT Creator:

    its been used by others for years and it worked perfectly AFAIK with gcc and clang before I started using qtcreator which complained.

    Here's my guess: Previously, the assert() macro was disabled. This caused the illegal code to be effectively "commented out", so the compiler didn't detect it. After the migration, the assert() macro was no longer disabled, so the compiler now sees the bad code and (correctly) complains.

    See http://www.cplusplus.com/reference/cassert/assert/. You could make your code work again by defining the NDEBUG macro, but be careful: This will disable all assert()s which might cause other errors to go undetected.

    P.S. The compiler is the one that complained, not Qt Creator.

  • 0 Votes
    3 Posts
    2k Views
    A

    Hello,

    Sorry for the novice mistake! I was trying to use different compilers in the NDK but i end up with the same error. The code i uploaded before was from one of my trials.
    I did change my configuration to x86 but i still get the same error. Since this is my 1st time for android, I may have missed something.

    The error stays the same. The 1st few line of my cmake error log states:

    Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed. Compiler: /home/user/android-ndk-r16b/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/i686-linux-android-g++ Build flags: Id flags: The output was: 1 /home/user/android-ndk-r16b/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin/ld: error: cannot open crtbegin_dynamic.o: No such file or directory /home/user/android-ndk-r16b/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin/ld: error: cannot open crtend_android.o: No such file or directory /home/user/android-ndk-r16b/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin/ld: error: cannot find -lstdc++ /home/user/android-ndk-r16b/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin/ld: error: cannot find -lm /home/user/android-ndk-r16b/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin/ld: error: cannot find -lc /home/user/android-ndk-r16b/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin/ld: error: cannot find -ldl collect2: error: ld returned 1 exit status

    and the cmake output states

    -- The CXX compiler identification is GNU 4.9.0 -- Check for working CXX compiler: /home/user/android-ndk-r16b/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/i686-linux-android-gcc -- Check for working CXX compiler: /home/user/android-ndk-r16b/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/i686-linux-android-gcc -- broken CMake Error at /usr/share/cmake-3.5/Modules/CMakeTestCXXCompiler.cmake:54 (message): The C++ compiler "/home/user/android-ndk-r16b/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/i686-linux-android-gcc" is not able to compile a simple test program. It fails with the following output: Change Dir: /home/user/testProjects/build-bubbleWork-Android_for_x86_GCC_4_9_Qt_5_9_3_for_Android_x86-Default/CMakeFiles/CMakeTmp Run Build Command:"/usr/bin/make" "cmTC_c05c5/fast" /usr/bin/make -f CMakeFiles/cmTC_c05c5.dir/build.make CMakeFiles/cmTC_c05c5.dir/build make[1]: Entering directory '/home/user/testProjects/build-bubbleWork-Android_for_x86_GCC_4_9_Qt_5_9_3_for_Android_x86-Default/CMakeFiles/CMakeTmp' Building CXX object CMakeFiles/cmTC_c05c5.dir/testCXXCompiler.cxx.o /home/user/android-ndk-r16b/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/i686-linux-android-gcc -o CMakeFiles/cmTC_c05c5.dir/testCXXCompiler.cxx.o -c /home/user/testProjects/build-bubbleWork-Android_for_x86_GCC_4_9_Qt_5_9_3_for_Android_x86-Default/CMakeFiles/CMakeTmp/testCXXCompiler.cxx Linking CXX executable cmTC_c05c5 /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_c05c5.dir/link.txt --verbose=1 /home/user/android-ndk-r16b/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/i686-linux-android-gcc CMakeFiles/cmTC_c05c5.dir/testCXXCompiler.cxx.o -o cmTC_c05c5 -rdynamic /home/user/android-ndk-r16b/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin/ld: error: cannot open crtbegin_dynamic.o: No such file or directory
  • 0 Votes
    6 Posts
    6k Views
    SGaistS

    Remove the -j 8. The error is somewhere else. These are just warnings.

  • 0 Votes
    5 Posts
    4k Views
    F

    @Chris-Kawa Sometimes you forget to update deploy dlls, in that case runtime vs compiletime versions in "about window" would be helpful.
    Even if you use auto windeployqt command, you'll still need to copy other dlls (OpenSSL, etc) by hand, there you'll forget.

  • 0 Votes
    5 Posts
    3k Views
    raven-worxR

    @KroMignon
    you can try the following:

    QMAKE_CXXFLAGS_RELEASE -= -Os QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO -= -Os

    Maybe add an other optimization flag as desired.

  • remove -fpermissive warning

    Unsolved General and Desktop
    5
    0 Votes
    5 Posts
    11k Views
    kshegunovK

    @Andy314

    In "normal" subclassing without templates there is a simple lookup -mechanism to find identifier in a funktion of the derived class: Search in the base class , if not found search in the global namespace.

    In "normal subclassing" the class is known, while with templates the class is generated by the compiler when instantiation is performed. If you don't make a specialization of the template, no code will be ever generated for the template. So when reading the template the compiler is "confused" how to deduce which count() exactly you mean. Granted, most of the time it's the base class/derived class' implementation, but this gets really complicated really fast when the overloading rules should be applied. That's why it's whining (mostly harmlessly) that you "should" specify which function exactly you mean (as required by the C++ standard).

    This blows up my code at thousands of lines very much and I dont like it. To avaid this error for memberfunctions I can integrate a compiler switch -fpermissive but I get the warnings for it.

    Templates are pretty verbose, I sympathize, but switching off compiler warnings/errors is not a good solution. As I mentioned, -fpermissive includes very many warnings/errors, most of which are quite important and you'd get much more headaches by switching it off, than by explicitly specifying which functions you want called. If you still insist on using the flag, you can set it in the project file through the QMAKE_CXXFLAGS variable:

    QMAKE_CXXFLAGS += -fpermissive

    Kind regards.

  • 0 Votes
    2 Posts
    2k Views
    B

    I've found the response.
    There is a positionIndependentCode property in the cpp module.
    So on can remove -fPIC by adding cpp.positionIndependentCode: false.

    This property is supposed to be undefined by default, but it seems to resolve to true for my toolchain.

  • 0 Votes
    2 Posts
    1k Views
    raven-worxR

    what is your Qt version and target platform?

  • Cannot find -lGL

    Unsolved General and Desktop
    4
    0 Votes
    4 Posts
    2k Views
    SGaistS

    Hi and welcome to devnet,

    Installing the libgl1-mesa-dev package is the correct solution. libGL's location can change depending on whether you are using a 32 or 64 bit version of Ubuntu.

    Note that this question has already been asked many times on this forum, you should search without the minus before lGL.

  • 0 Votes
    3 Posts
    1k Views
    K

    I am able to compile a Hello world cpp code and generated binary file is successfully running on my board.

  • 0 Votes
    10 Posts
    5k Views
    T

    @Karen-Morrissey
    I think because when you did ./configure to look for needed libraries, it first found those in /usr/lib64.

    Why not to force the configure to use those for 32bit by adding

    -L /path/to/lib/32bit -lpthread -lm -lc

    to your configure command

  • 0 Votes
    1 Posts
    704 Views
    No one has replied
  • 0 Votes
    1 Posts
    935 Views
    No one has replied