clion

Process finished with exit code -1073741515 (0xC0000135) after trying to run sample code using OpenCV library

不打扰是莪最后的温柔 提交于 2019-12-11 04:59:51
问题 I've been trying to run OpenCV using CLion IDE under Windows . When I try to run this sample code for loading and displaying an image #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #include <iostream> using namespace cv; using namespace std; int main( int argc, char** argv ) { if( argc != 2) { cout <<" Usage: display_image ImageToLoadAndDisplay" << endl; return -1; } Mat image; image = imread("earth.jpg", CV_LOAD_IMAGE_COLOR); // Read the file if(! image.data ) //

Clion exit code -1073741571 (0xC00000FD)

北城以北 提交于 2019-12-11 04:59:38
问题 I get a weird exit code in clion: exit code -1073741571 (0xC00000FD) This is my code: int main() { std::cin.sync_with_stdio(false); std::cin.tie(nullptr); freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); int n = 0, i = 0, j = 0; int arr[30007][5]; for (i = 1; i <= 30000; i++) arr[0][i] = 1; //... return 0; } I tested it and find out its because of this line: int arr[30007][5]; I had no problem in declaration of array in size of less than 1.000.000 2 days ago and now I get

How to correctly create a CMake file for a modular project

匆匆过客 提交于 2019-12-11 04:56:59
问题 Suppose C++ project A as my main program and project B is my module that is shared object (.so). Project A consist source and headers that is common between both projects. Project A load module .so file in runtime. Project A: class-AI.cpp (It contains function funcA) class-AI.h class-AII.cpp class-AII.h class-AIII.cpp class-AIII.h main.cpp Project B: (Shared Object) class-BI.cpp (Its inherit from class-AI) class-BI.h With following CMake files both project build successfully. Project A

OpenCV CLion (Cmake) linking issue - cmake reports a strange error

时光总嘲笑我的痴心妄想 提交于 2019-12-11 02:57:42
问题 I can't get my CLion to build the project because of a weird error upon saving my CMakeLists and/or building the project: Error:Found package configuration file: /usr/share/opencv/OpenCVConfig.cmake but it set OpenCV_FOUND to FALSE so package "OpenCV" is considered to be NOT FOUND. Source file : #include <stdio.h> #include <opencv2/opencv.hpp> using namespace cv; int main(int argc, char** argv ) { Mat image; image = imread( "lena.jpg", 1 ); if ( !image.data ) { printf("No image data \n");

Linking shared dll library cmake clion project

六眼飞鱼酱① 提交于 2019-12-11 02:32:48
问题 I currently have two C projects on Clion with cmake. One of the projects is named "sharedLibsDemo" and I am trying to create a shared library in this project. In the other project I want to use the library that was created by the "shared" project. Currently, in the "sharedLibsDemo" project I have the following cmake: cmake_minimum_required(VERSION 3.7) project(sharedLibsDemo) set(CMAKE_C_STANDARD 11) INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}") set(SOURCE_FILES shared.c shared.h main.c)

CLion can't find CMake generated headers?

不问归期 提交于 2019-12-10 23:18:34
问题 Going through the CMake tutorial: ├── CMakeLists.txt ├── src │ └── main.cpp └── templates └── fooConf.h.in CMakeLists.txt cmake_minimum_required(VERSION 3.2) project(foo) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") set(PROJECT_SOURCE_DIR src) set(PROJECT_TEMPLATE_DIR templates) set(SOURCE_FILES ${PROJECT_SOURCE_DIR}/main.cpp) set(${PROJECT_NAME}_MAJOR 0) set(${PROJECT_NAME}_MINOR 1) set(${PROJECT_NAME}_MICRO 1) configure_file ( "${PROJECT_TEMPLATE_DIR}/fooConf.h.in" "${PROJECT_SOURCE

List of all errors in project in CLion

≡放荡痞女 提交于 2019-12-10 14:39:51
问题 CLion 2016.2 helpfully detects potential errors in the file you're editing, which can be seen in the validation bar to the right of the code. That's just a single file though, is there a way (like a tool window) to get a list of all such warnings in the whole project, or specific parts of it? Bonus points if it also lists warnings and errors from the compiler, though that's less important, because the compiler output already includes any it found. 回答1: Yes, it is possible. The feature you are

How to show colored console output in Clion

梦想与她 提交于 2019-12-10 14:34:26
问题 I am trying to write a C++ application with Clion that makes use of colored console output using ASCII sequences. When I run the program in Clion, the colors are not shown. But when I run the program in my terminal, then I can see the colors. Is there a hidden option I have to enable for this to work? EDIT: I meant ANSI 回答1: CLion's console is not a terminal (at least yet), but nothings prevents from interpreting the control codes related to color and highlight the text accordingly. This is

C++ Debug Window showing "<incomplete type> for string variable

戏子无情 提交于 2019-12-10 13:29:49
问题 To my knowledge I'm initializing a string a fairly normal way and when I debug, the variables window in my IDE (CLion) shows its value as <incomplete type> . I have some simple code that results in the issue for the string variable Bob . #include <iostream> int main() { std::string Bob = "this doesn't show up in the variables window"; std::cout << Bob << std::endl; return 0; } I don't know what impact it has but I'll include the CMakeLists file that appears to be the simplest that I can use.

CLion does not paste the correct snippet from clipboard

两盒软妹~` 提交于 2019-12-10 13:13:16
问题 while having used Java and PHP most of the time in my programming "carreer", I am now trying to learn C++ more in-depth. For that, I am using CLion as my IDE - mostly because I am very familiar with phpStorm and IntelliJ IDEA and I don't want to "learn" a new IDE in addition to learning a new language. Now, I have hit the problem, that CLion does not take my current Clipboard content when pressing Ctrl + V . The snippet was copied from the Browser (Firefox 41.0.1) and it neither works with