I am planning to make a driver for ejecting cd/dvd drive in computer with c++/c programming language.
But, frankly telling , I have just the knowledge of c/c++ , but no clue how to start making the driver.
Please, guide me through it and the things I need to study .
Please, if possible post the link which may be helpful to me.
it's showing the following errors: 1)default.cpp:(.text+0x28): undefined reference to `__imp_mciSendStringA'
2) c:\program files (x86)\dev-cpp\mingw64\x86_64-w64-mingw32\bin\ld.exe final link failed: Invalid operation
3)C:\Users\sanyam gupta\Desktop\collect2.exe [Error] ld returned 1 exit status
You are obviously using MinGW, so you need to specify -lwinmm on the command line options (or link to winmm with your IDE), because the #pragma way of linking only works with MSVC.
I am using devc++ compiler for them!
Should I use microsoft visual studio . ? would that be fine ?
And Frankly telling , I dont know what is MinGW , MSVC ?
Can you please me more about it ?
MSVC is MicroSoft Visual C, its the compiler that comes with microsoft visual studio. It is another option for a compiler. It is generally agreed that if you are building applications for Windows, it is good to use Microsoft visual studio (though not necessary), due to the various options it gives for decreasing development time, and the fact that it will definitely provide anything.
Anyone, to add the -lwinmm line to your command line on Dev-C++, you can do something like open your project, goto "Project Settings", find the link options setting. This should be in one of the tabs. Just add "-lwinmm" to that. Sorry if this isn't very descriptive, I don't actually have Dev-C++ on me at the moment (and I haven't used it for years).
Various things. On Windows, I most commonly use Code::Blocks (see http://www.codeblocks.org/ ), or the command line and Cygwin tools. On Linux, I use Vi, and I don't use Max :). I do occasionally use Microsoft Visual 2010 Express for the functions and structures that MinGW doesn't provide, but apart from that, mostly Code::Blocks.