Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Linux to Windows platform
Forum Updated to NodeBB v4.3 + New Features

Linux to Windows platform

Scheduled Pinned Locked Moved General and Desktop
5 Posts 4 Posters 1.7k Views 2 Watching
  • 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.
  • ArasuA Offline
    ArasuA Offline
    Arasu
    wrote on last edited by
    #1

    I am new user in QT Creator, i have a exist project to develop our previous developers in Linux using C++. Now i have to take responsible for this project to future enhancement. i have to face these kinds of errors. Any one can kindly advice me.

    ..\ecg12i_backup\PatientList.cpp: In function 'void on_Patient_Info_List_Screen_show(PATIENT_LIST*)':
    ..\ecg12i_backup\PatientList.cpp:93:47: error: 'alphasort' was not declared in this scope
    n = scandir(PATIENTINFODIRLOC, &namelist, 0, alphasort); //It scans for files in Directory PATIENTINFODIRLOC and put it in namelist
    ^
    ..\ecg12i_backup\PatientList.cpp:93:56: error: 'scandir' cannot be used as a function
    n = scandir(PATIENTINFODIRLOC, &namelist, 0, alphasort); //It scans for files in Directory PATIENTINFODIRLOC and put it in namelist
    ^
    ..\ecg12i_backup\PatientList.cpp:102:40: error: 'rindex' cannot be used as a function
    ptr = rindex(namelist[n]->d_name, '.');

    1 Reply Last reply
    0
    • V Offline
      V Offline
      Vince Golubic
      wrote on last edited by
      #2

      Arasu:

      First, make sure you have done a 'Make clean' if you have untared or check out any 'git' or CVS distribution (I'm assuming previous version was in a Linux archive that you are building from? any old .obj, release or debug directories cleaned out as well. As long as there is a *.pro file with the source code (otherwise you need to make your own) you should be ok with qmake over on Windows, just check that any Linux dependencies have been excluded or updated in the .pro file (lots of examples on web to show how to do that). Once your .pro file has been 'adjusted' to a Windows build environment you should be ok assuming the Windows version of QtCreator, VStudio or Eclipse is configured properly (i.e, Make path, compiler paths, etc ).

      -Vince

      1 Reply Last reply
      0
      • JKSHJ Offline
        JKSHJ Offline
        JKSH
        Moderators
        wrote on last edited by
        #3

        @Arasu said:

        ..\ecg12i_backup\PatientList.cpp:93:47: error: 'alphasort' was not declared in this scope

        Check PatientList.cpp. Where should alphasort be declared?

        Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

        1 Reply Last reply
        0
        • ArasuA Offline
          ArasuA Offline
          Arasu
          wrote on last edited by
          #4

          What is the equivalent code for linux to windows

          for-----------scandir();

          n = scandir(PATIENTINFODIRLOC, &namelist, 0, alphasort);

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mchinand
            wrote on last edited by
            #5

            I think your best option is to convert calls to scandir() to a platform-independent method. Fortunately, QT's QDir::entryList() or QDir::entryInfoList() can do what you need.

            1 Reply Last reply
            1

            • Login

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