Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » MSVC 10 to Upp conversion
MSVC 10 to Upp conversion [message #32638] Mon, 30 May 2011 22:22 Go to previous message
nlneilson is currently offline  nlneilson
Messages: 644
Registered: January 2010
Location: U.S. California. Mojave &...
Contributor
I am trying to convert a command line app I got working in MSVC 10 into Upp. Then I will make a GUI for it.

It was originally written for Linux in 2005 and a patch for Windows a year or so later. It has not been maintained since then AFAIK.

After making a package in MyApps with the code, making a .cpp file and getting the linking taken of (so far) there were
many warnings regarding deprecation (I think that can be handled).

There were several errors.

I did a search and replace for strcasecmp to strcmp, I can handle the case later.

Here are the remaining errors and the code:
C:\MyApps\GUItiler\tilepack.cpp(61) : error C2065: 'DIR' : undeclared identifier
C:\MyApps\GUItiler\tilepack.cpp(61) : error C2065: 'd' : undeclared identifier
C:\MyApps\GUItiler\tilepack.cpp(66) : error C2065: 'd' : undeclared identifier
C:\MyApps\GUItiler\tilepack.cpp(66) : error C3861: 'opendir': identifier not found
C:\MyApps\GUItiler\tilepack.cpp(67) : error C2065: 'd' : undeclared identifier
C:\MyApps\GUItiler\tilepack.cpp(68) : error C2065: 'd' : undeclared identifier
C:\MyApps\GUItiler\tilepack.cpp(68) : error C3861: 'readdir': identifier not found
C:\MyApps\GUItiler\tilepack.cpp(68) : fatal error C1903: unable to recover from previous error(s); st
	opping compilation

// code that throws the errors

void ScanDatasetR(const char *path) {
    DIR *d;
    struct dirent *de;
    int l, x, y;
    string s;

    d = opendir(path);
    if (!d) return;
    while (de = readdir(d)) {
        if ((de->d_type == DT_DIR) && (de->d_name[0] != '.')) ScanDatasetR((string(path) + string(de->d_name) + "/").c_str());
        if (de->d_type == DT_REG) {
            s = de->d_name;
            if (sscanf(s.substr(0, 2).c_str(), "%x", &l) && sscanf(s.substr(2, 8).c_str(), "%x", &x) && sscanf(s.substr(10, 8).c_str(), "%x", &y)) {
		bm[(static_cast<unsigned __int64>(l) << 50) + (static_cast<unsigned __int64>(y >> 7) << 25) + (x >> 7)].push_back((x & 0x7f) + ((y & 0x7f) << 7));
            }
        }
    }
    closedir(d);
}


I am not that proficient with pointers so help would be appreciated.

With the " unable to recover from previous error(s); stopping compilation" there will probably be more later but just taking it a step at a time.

edit: I don't want to use MSVC for the GUI or anything else if it can be avoided.
I like Upp.

[Updated on: Mon, 30 May 2011 22:43]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Please recommend a scripting language
Next Topic: String to std::string conversion
Goto Forum:
  


Current Time: Thu May 09 03:38:55 CEST 2024

Total time taken to generate the page: 0.02725 seconds