| | |
compiling in 64-bit mode
Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Jun 2009
Posts: 33
Reputation:
Solved Threads: 0
I have this code:
the problem is, when I compile it in 32-bit mode, it can only access 2GB of my 8GB of RAM, so it can only work with small wordlists. Does anybody know if there is a simple way I can reconfigure my compiler (Microsoft Visual C++ 2008 Express Edition) to compile this code in 64-bit mode, enabling it to access all of my RAM? Or would I actually have to modify the code?
C++ Syntax (Toggle Plain Text)
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <fstream> #include <stdlib.h>//(for atoi to work) using namespace std; void usage() { cout << "Usage: <input1> <input2> <output>\n"; cout << "\n see README for more details.\n"; exit(1); } int main(int argc, char *argv[]) { cout << "\nshmoosh - concatenates and uniques wordlists into one\n"; if(argc!=4) usage(); vector<string> vec_wordlist_compilation; ///////////////////////////input1////////////////////////////// ifstream wordlistfile(argv[1]); if(!wordlistfile.is_open()) { cout<<"\nError opening file \'"<<argv[1]<<"\'\n"; exit(1); } int x=0; string word; while(getline(wordlistfile,word)){ vec_wordlist_compilation.push_back(word); x++; } cout << x << " words loaded from file \'"<<argv[1]<<"\'\n"; wordlistfile.close(); ///////////////////////////input2////////////////////////////// ifstream wordlistfiletwo(argv[2]); if(!wordlistfiletwo.is_open()) { cout<<"\nError opening file \'"<<argv[2]<<"\'\n"; exit(1); } int v=0; while(getline(wordlistfiletwo,word)){ vec_wordlist_compilation.push_back(word); v++; } cout << v << " words loaded from file \'"<<argv[2]<<"\'\n"; wordlistfiletwo.close(); ////////////////////////////sort////////////////////////////// cout << "\nsorting " << v+x << " words, removing duplicates...\n"; //sort vector (least to greatest)... sort(vec_wordlist_compilation.begin(),vec_wordlist_compilation.end()); //remove duplicates... vec_wordlist_compilation.resize((unique(vec_wordlist_compilation.begin(),vec_wordlist_compilation.end()))-vec_wordlist_compil ation.begin()); /*for(unsigned int c=0;c<vec_wordlist_compilation.size();c++) cout << vec_wordlist_compilation[c] << "\n";*/ cout << vec_wordlist_compilation.size() << " unique words remain.\n"; ////////////////////////////output////////////////////////////// ofstream output(argv[3]); for(unsigned int c=0;c<vec_wordlist_compilation.size();c++) output << vec_wordlist_compilation[c] << "\n"; return 0; }
the problem is, when I compile it in 32-bit mode, it can only access 2GB of my 8GB of RAM, so it can only work with small wordlists. Does anybody know if there is a simple way I can reconfigure my compiler (Microsoft Visual C++ 2008 Express Edition) to compile this code in 64-bit mode, enabling it to access all of my RAM? Or would I actually have to modify the code?
•
•
Join Date: Jul 2009
Posts: 3
Reputation:
Solved Threads: 2
Recommend article Seven Steps of Migrating a Program to a 64-bit System.
Last edited by Andrey_Karpov; Aug 11th, 2009 at 2:26 am.
![]() |
Similar Threads
- protected mode switch (Assembly)
- DirectDraw 8-bit color algorithm (Game Development)
- Write Your First Application in Win32 Using Assembly (Assembly)
- Graphics in Pixel,Mode13h:Part 1 (C++)
- Unable to run the application on machine without visual installed (C)
- Longhorn Beta in 5 Months! (Windows NT / 2000 / XP)
- FPS Question (Monitors, Displays and Video Cards)
- Help me with my monitor (Monitors, Displays and Video Cards)
Other Threads in the C++ Forum
- Previous Thread: Virtual Inheritance Doubt
- Next Thread: C++ Callback Pointers help
| Thread Tools | Search this Thread |
api array arrays based beginner binary bitmap c++ c/c++ calculator char char* class code coding compile compiler console conversion count data database delete deploy developer dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game getline givemetehcodez graph gui homeworkhelp homeworkhelper iamthwee ifstream input int java lib linker list loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference rpg sorting string strings temperature template test text text-file tree url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






