But then multiple inclusion is possible?The whole point of #pragma is for the compiler to ignore
But then multiple inclusion is possible?The whole point of #pragma is for the compiler to ignore
the way it works is that the device is perpetually on and keeps spitting out random numbers to a buffer. then users can use the cpps or dlls to download data from that buffer.
ok, i'll try running this on MS VC++ exp. hope that works. will post my results.
was anyone else able to get it to work?
ok i downloaded and installed MS VC++ express. Now, how the heck do I compile/run my cpp? There is no compile/run option in the damn thing (trust MS to build an evil app). In the words of Dilbert, "GAAAAAA!"
Create a project. Unless you are making a windows application, you want a console application. The project should be a Win32 Console Application. I believe it is still called that in VC++ 2008. Be careful, there are other similar ones that use .NET and you don't want that.
In the Application Settings page of the new project wizard, check the "Empty Project" checkbox.
Then when the project opens, Add existing item and select any and all files that you have. You can compile those separately, and if you create a new cpp file with a main() function you can build the whole thing into an executable.
Are you sure you need a "truly" random number?I am working on a personal project which requires me to generate large amounts of truly random numbers (hint: its about probabilities).
My philosophy is that it's "random enough" if it's unpredictable (and usually evenly distributed... assuming you don't want a particular bias, or some particular statistical distribution.) For example, the machines in casinos are not using any sort of quantum random generator, and most probability simulations also use pseudorandom numbers.
lol @ "[b]it's". yea, you're right...anything unpredictable enough is good enough to be random. i guess what i meant was that i wanted something better than rand()/srand(). just happened to run into the qrbg, it was free AND it had a C++ library so it looked ideal for me.
now, if I can just figure out how to get MS VC++ to work
ok i did as you said...i created the project as a Win32 console app and checked 'empty project', then added my cpp to it. now how do I compile? when i hit build, I get the following error:
this was running ok on borland???Code:1>------ Build started: Project: test, Configuration: Debug Win32 ------ 1>Embedding manifest... 1>.\Debug\test.exe.intermediate.manifest : general error c1010070: Failed to load and parse the manifest. The system cannot find the file specified. 1>Build log was saved at "file://c:\Documents and Settings\Shar\test\test\Debug\BuildLog.htm" 1>test - 1 error(s), 0 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I don't think you picked Win32 Console Application, I think you picked something that was close to that but not exactly that. I don't have VC++ 2008 in front of me to verify, though.
The reason you want Win32 Console Application is because that particular project type doesn't add the .NET stuff used in C++/CLI or Managed C++. I think the manifest is part of that.
Create another new project and check to see if maybe there is a similar project type in a different category that is closer to Win32 Console Application. If there isn't, then maybe I'm wrong and you'll have to find a way to turn off the manifest stuff in your current project.
Maybe turn off ATL and MFC support in the application wizard?
Last edited by Daved; 05-16-2008 at 08:32 PM.
ok, i'm compiling via the command prompt using cl /EHsc file.cpp
all the previous errors went away. instead i started getting these:
in QRBG.h, i noticed that this line is # if defined (PLATFORM_LINUX)...so i commented the lines out.Code:example0.cpp c:\qrbg\src\QRBG.h(339) : error C2079: 'QRBG::timeStart' uses undefined struct ' timeval' c:\qrbg\src\QRBG.h(339) : error C2079: 'QRBG::timeEnd' uses undefined struct 'ti meval'
now, i'm getting these errors:
help!Code:/out:example0.exe example0.obj example0.obj : error LNK2019: unresolved external symbol "public: __thiscall QRB G::~QRBG(void)" (??1QRBG@@QAE@XZ) referenced in function _main example0.obj : error LNK2019: unresolved external symbol "public: unsigned int _ _thiscall QRBG::getBytes(unsigned char *,unsigned int)" (?getBytes@QRBG@@QAEIPAE I@Z) referenced in function _main example0.obj : error LNK2019: unresolved external symbol "public: double __thisc all QRBG::getDouble(void)" (?getDouble@QRBG@@QAENXZ) referenced in function _mai n example0.obj : error LNK2019: unresolved external symbol "public: float __thisca ll QRBG::getFloat(void)" (?getFloat@QRBG@@QAEMXZ) referenced in function _main example0.obj : error LNK2019: unresolved external symbol "public: long __thiscal l QRBG::getLongInt(void)" (?getLongInt@QRBG@@QAEJXZ) referenced in function _mai n example0.obj : error LNK2019: unresolved external symbol "public: int __thiscall QRBG::getInt(void)" (?getInt@QRBG@@QAEHXZ) referenced in function _main example0.obj : error LNK2019: unresolved external symbol "public: unsigned char __thiscall QRBG::getByte(void)" (?getByte@QRBG@@QAEEXZ) referenced in function _ main example0.obj : error LNK2019: unresolved external symbol "public: void __thiscal l QRBG::defineUser(char const *,char const *)" (?defineUser@QRBG@@QAEXPBD0@Z) re ferenced in function _main example0.obj : error LNK2019: unresolved external symbol "public: void __thiscal l QRBG::defineServer(char const *,unsigned int)" (?defineServer@QRBG@@QAEXPBDI@Z ) referenced in function _main example0.obj : error LNK2019: unresolved external symbol "public: __thiscall QRB G::QRBG(unsigned int)" (??0QRBG@@QAE@I@Z) referenced in function _main example0.exe : fatal error LNK1120: 10 unresolved externals
The linker cannot find those functions. Are they defined in another cpp file that you didn't compile?
if you want really simple and very random numbers use uinitialized pointers
ok those functions were indeed from qrbg.cpp. so i ran them together, like so:
cl /EHsc example0.cpp qrbg.cpp
now, i just have 2 dozen new errors . oh well, back to work.