CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: qt apple mac

  1. #1
    Join Date
    Mar 2010
    Location
    Melbourne Australia
    Posts
    454

    qt apple mac

    when using QT IDE in Apple Mac 10.6.3 , I am using STD C++ libraries
    iostream , fstream and string

    when compiling applkcation I get the following error

    /Users/aamir/untitled/copyfile/copyfile1-build-desktop/../copyfile1/main.cpp:18: error: 'fstream' was not declared in this scope

    I get the same for string as well as iostream , if I include any QT libraries then it is fine as you can see QString work fine, any help be much appreciated

    here is my code
    Code:
    #include <QtCore/QCoreApplication>
    #include <iostream>
    #include <fstream>
    #include <string>
    #include <string.h>
    #include <QtCore>
    
    
    typedef struct _inbuffer
    {
        unsigned char buf[200];
    } inbuffrer;
    
    int main(int argc, char *argv[])
    {
        QCoreApplication a(argc, argv);
        QString filename1 = "appzapper.dmg";
        fstream instream(filename1.toStdString().c_str(),std::ios::binary|std::ios::in);
    
        return a.exec();
    }

  2. #2
    Join Date
    Nov 2008
    Location
    England
    Posts
    748

    Re: qt apple mac

    std::fstream

    fstream is a member of namespace std.
    Get Microsoft Visual C++ Express here or CodeBlocks here.
    Get STLFilt here to radically improve error messages when using the STL.
    Get these two can't live without C++ libraries, BOOST here and Loki here.
    Check your code with the Comeau Compiler and FlexeLint for standards compliance and some subtle errors.
    Always use [code] code tags [/code] to make code legible and preserve indentation.
    Do not ask for help writing destructive software such as viruses, gamehacks, keyloggers and the suchlike.

  3. #3
    Join Date
    Mar 2010
    Location
    Melbourne Australia
    Posts
    454

    Re: qt apple mac

    Thank You

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured