Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. How to concretely fix the following error message: what(): basic_string::_S_construct null not valid

How to concretely fix the following error message: what(): basic_string::_S_construct null not valid

Scheduled Pinned Locked Moved Installation and Deployment
2 Posts 2 Posters 1.8k Views
  • 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.
  • D Offline
    D Offline
    dncg
    wrote on last edited by
    #1

    Hello,

    Each time I try to run this code, the unix terminal shows me the following error message:

      *  terminate called after throwing an instance of 'std::logic_error'
        what():basic_string::_ S_construct null not valid
        Press <RETURN> to close this window...*
    

    This is my code:

    #include<opencv2/opencv.hpp>
    #include<opencv2/highgui.hpp>
    #include<iostream>

    using namespace std;
    using namespace cv;

    int main(int argc,char **argv){

     //Create a window
     namedWindow( argv[1], WINDOW_AUTOSIZE );
     
     //Load an image
     Mat image=imread( argv[1] );
    
     //Show the image in the window
     imshow( argv[1] );
    
     //Clean up
     destroyWindow( argv[1] );
     exit( 0 );
    

    }

    Could you tell me how to concretely fix this problem please?
    Thank you in advance

    Information: Operating system: LinuxMint 17
    I am working with OpenQt 3.1.2 (opensource)

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

      Hi and welcome to devnet,

      Unless I'm missing something, this is not related to Qt. You should ask this question on the OpenCV forums

      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
      0

      • Login

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