<< May 1, 2020 | Home | May 3, 2020 >>

qt-creator: make stdout work in application-output-view

I really do love qt-creator and it is my IDE of choice for c++-development. But it has here and there some flaws....beside the fact that there are not tabs to represent the opened files, one strange thing is that outputs to stdout get are not visibile immediately. I'm not 100% sure how it is triggered (maybe when the internal buffer is filled completely?).

In order to show the output directly, just add this to your main.cpp:

setbuf(stdout, NULL);

Another flaw is that from time to time you have invalid start-configs and qt-creator refuses to start your application. This is due to the path not set properly. Here helps a restart and the path is set correctly afterwards

Reference(setbuf): https://bugreports.qt.io/browse/QTCREATORBUG-3994

Tags :

CMake Error: CMake can not determine linker language for target: [XYZ]

Just stumpled over a strange problem using CMake. A usually straight forward setup adding a 2nd executable lead to an error like this:

-- Configuring done
CMake Error: CMake can not determine linker language for target: Tests
-- Generating done

This might be related to me now using cmake 3.14 as minimum in the CMakeLists.txt-file or might be related to using CPM as CMake-internal package-manager (which requires 3.14). Not quite sure.

To make the long story short. I fixed it by adding following to the specific target:

    set_target_properties(Tests PROPERTIES LINKER_LANGUAGE CXX)

Reference: https://stackoverflow.com/questions/56462415/cmake-error-cannot-determine-link-language-for-target

Tags :
<< May 1, 2020 | Home | May 3, 2020 >>