Friday 17 January 2014

Running C with GCC compiler in windows with Netbeans IDE

This pretty simple layman question, but still some tricky to install GCC compiler in windows, making functional with C or any thing else C++, Fortan etc.

Recently, i need to run program for OpenMP (For parallel programming  ), parrallel thread executed in order to complete my course syallabus as  a part of Advance computer architecture. So little time, it took to initially figure out how to install it, & work for it with GCC. Prior to it, it was never been with GCC, all we have is turbo C++ Blue screen, in college time. But now that was obsolete, say working to as similar as in early 90's. So need change there.  So here it goes.

Installing on window there is: MinGw( www.mingw.org/)  compiler system that seems fine. It give you the windows installation manager
package from where you can install all the required package one by one exactly as similar as linux way.



Download and Run MinGw installation manager.
We need to install following packages as mandatory for C/C++ .
1) MinGw-Developer tool
2) mingGW32-base [This is required for C]
3) mingGwGcc-G++ [This is for C++]4) msys-base  [It include core basic utility functions]


After installation of all those package, 
Create a new project in NetBeans
Select tab C/C++ Applications 


The general package structure will be created. 
Now you have some tricky task. Those are setting environmental variable that is [Path] variable for MinGw and msys in your 
windows maching (Right Click My Computer-->Properties->Advanced Properties-->Environment Variable)

You need to set the path variable upto the bin directory. For ex : If your MinGw is installed as C:\MinGw then
path will be C:\MinGW\bin
similarly for mySys it would be C:\MinGW\msys\1.0\bin    
Note that place semicolon(;)  before and after of these variable entries in path variable .

Next you need to set configuration in you netbeans. For that. 
Go to Tools -->Options-->C/C++ tab

There most probably, [Make command] tab will be not mentioned explicitly, you need to mention it ,
browse the button and select C:\MinGW\msys\1.0\bin\make.exe file of MySys. 

Check all associated variable as well , if they are set correctly. 
Finally build the project , if it is build successfully, Congratulations.. !! 
You are done. ..









Cheers.. !!
Happy Learning. !!!

Tuesday 7 January 2014

How to fix this window is not genuine error in windows 7

Guys, the problem was, since so many months i was getting this error, i used to always cancel "windows not genuine message" & then run my computer.
Today, it was extreme !! Normally i don't care for desktop background & it was always black because of windows not genuine, As i changed at set the windows background wall, after some time, it automatically changed my background old nasty black background. So it was quite hectic. I thought , common get rid of this.

So here is the one step solution.

>> Run command line as "Administrator"
>>Then type "SLMGR -REARM" 

After some time you will get, command executed successfully message which ask you to restart the system.

Restart it , You will never get "Not genuine windows message" !!

Happy Learning
Cheers ..

Making a bootable windows 7 disk from file

Making a bootable windows 7  disk from the copied files from windows 7 disk:
-----------------------------------------------------------------------------------------

Guys, this was really a hectic task , if you are not aligned with the proper techniques to make bootalbe windows.  Last night, it wasted by whole night too. 

The problem was  my brother's OS get crashed, now I don't have bootable DVD, only all i have is , windows splitted copied files. 
So my first choice was Nero, I didn't have Nero too, downloaded Nero 14 trial for 15 days , tried to make bootable with it, but it sucked me, all it allowed was to allow burning maximum file size of 200MB. :( 

My Next try was Nero 7, Okey it was very difficult to get if from internet for free, finally got it, from some where, a cracked version, Installed and tried to make bootable DVD for windows 7 , again it sucked me, it only allowed me to make a bootable file that exceeds no more than 2GB, I was having 3.4GB of windows 7 raw file. :( What to do !!!

Wasted one night !!
Next I came up with the solution, found a very good developer tool known as Image burn (http://www.imgburn.com/) having a file size of just 3.3 MB, & was awesome. !!! Can not imagine, such a decent and best tool !! 

All you need to do is :
=> Click the ‘Write files/folders to disc’ button.
=>Insert a writable DVD disc [The message in  status bar should say ready]
=>Add the installation source folder and files 
=>On Boot tab,     Locate your Boot file for windows7 generally it is located inside /Boot folder with the name etfsboot.com
[Note: this is important don't  miss it.]
=>Enter ‘Microsoft Corporation’ in the ‘Developer ID’ field.
=>Enter ’07C0′ in the ‘Load Segment’ field.
=>Enter ‘8‘ in the ‘Sectors To Load‘ field.

You are done, finally click on Build Button. Yes !! 
Cheers.. !!  Your bootable CD is ready .. !! 











Saturday 4 January 2014

Making USB Pendrive bootable for windows 7 set up

Got a quick sort of problem today, needed to make a bootable pen drive for windows 7 from the file stored in my computer !!


So here is what i did !!
1) Run as system Administration in command
2) Navigate to cd c:\windows\system32
3) Type:  DISKPART
4) Type: LIST DISK (All the drives including your USB will be listed)
5) Type : SELECT DISK yourDiskName  (Your usb disk name as it is show by list disk)

After selecting disk type following commands sequentially:

CLEAN
CREATE PARTITION PRIMARY
SELECT PARTITION 1
ACTIVE
FORMAT FS=NTFS QUICK  (quick will enable you to format faster)
(it may take a couple minutes, depending on the USB drive size)

Than type:
ASSIGN
EXIT



Now open a command prompt and go to the directory where BOOTSECT.EXE  file is located for your windows 7 file.

After navigating to the directory : type

BOOTSECT.EXE /NT60 H:  (Here h is the usb drive name)

If all thing are executed successfully, Congratulations your pen drive has become bootable now.  Now you can copy the windows files directly into your usb drive.