Linux to Windows platform



  • 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, '.');



  • 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


  • Moderators

    @Arasu said:

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

    Check PatientList.cpp. Where should alphasort be declared?



  • What is the equivalent code for linux to windows

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

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



  • 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.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.