Quantum Random Bit Generator

This is a discussion on Quantum Random Bit Generator within the C++ Programming forums, part of the General Programming Boards category; Originally Posted by Daved Don't forget to compile QRBG.cpp and/or any other source files, then link them together. Your command ...

  1. #46
    Registered User
    Join Date
    May 2008
    Posts
    81
    Quote Originally Posted by Daved View Post
    Don't forget to compile QRBG.cpp and/or any other source files, then link them together. Your command line only compiles example0.cpp. That compilation succeeds (congratulations on getting that far), but now you need to link all other source files.

    I don't remember if it was mentioned earlier, but if the library provides source files for you to compile, then add those to the command line (I don't know the exact syntax on the command line). If they provide pre-compiled libraries, then link to those libraries (I don't know the exact syntax on the command line).
    Hi Daved,

    I compiled QRBH.cpp also last time, still got those errors.

    There are only 4 files total: example0.cpp, example1.cpp, QRBG.cpp, QRBG.h

    The cpp file example0 and example1 are independent, each of which included QRBG.h, which in turn includes and QRBG.cpp. Even if I compile all 4 together, I get the same errors:
    Code:
    C:\QRBG\src>cl /EHsc example0.cpp QRBG.cpp example1.cpp
    Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.21022.08 for 80x86
    Copyright (C) Microsoft Corporation.  All rights reserved.
    
    example0.cpp
    QRBG.cpp
    example1.cpp
    Generating Code...
    Microsoft (R) Incremental Linker Version 9.00.21022.08
    Copyright (C) Microsoft Corporation.  All rights reserved.
    
    /out:example0.exe
    example0.obj
    QRBG.obj
    example1.obj
    example1.obj : error LNK2005: _main already defined in example0.obj
    QRBG.obj : error LNK2019: unresolved external symbol _connect@12 referenced in f
    unction "private: void __thiscall QRBG::Connect(void)" (?Connect@QRBG@@AAEXXZ)
    QRBG.obj : error LNK2019: unresolved external symbol _htons@4 referenced in func
    tion "private: void __thiscall QRBG::Connect(void)" (?Connect@QRBG@@AAEXXZ)
    QRBG.obj : error LNK2019: unresolved external symbol _inet_addr@4 referenced in
    function "private: void __thiscall QRBG::Connect(void)" (?Connect@QRBG@@AAEXXZ)
    QRBG.obj : error LNK2019: unresolved external symbol _gethostbyname@4 referenced
     in function "private: void __thiscall QRBG::Connect(void)" (?Connect@QRBG@@AAEX
    XZ)
    QRBG.obj : error LNK2019: unresolved external symbol _socket@12 referenced in fu
    nction "private: void __thiscall QRBG::Connect(void)" (?Connect@QRBG@@AAEXXZ)
    QRBG.obj : error LNK2019: unresolved external symbol _closesocket@4 referenced i
    n function "private: void __thiscall QRBG::Close(void)" (?Close@QRBG@@AAEXXZ)
    QRBG.obj : error LNK2019: unresolved external symbol _shutdown@8 referenced in f
    unction "private: void __thiscall QRBG::Close(void)" (?Close@QRBG@@AAEXXZ)
    QRBG.obj : error LNK2019: unresolved external symbol _ntohl@4 referenced in func
    tion "private: unsigned int __thiscall QRBG::AcquireBytesFromService(unsigned ch
    ar *,unsigned int)" (?AcquireBytesFromService@QRBG@@AAEIPAEI@Z)
    QRBG.obj : error LNK2019: unresolved external symbol _recv@16 referenced in func
    tion "private: unsigned int __thiscall QRBG::AcquireBytesFromService(unsigned ch
    ar *,unsigned int)" (?AcquireBytesFromService@QRBG@@AAEIPAEI@Z)
    QRBG.obj : error LNK2019: unresolved external symbol _send@16 referenced in func
    tion "private: unsigned int __thiscall QRBG::AcquireBytesFromService(unsigned ch
    ar *,unsigned int)" (?AcquireBytesFromService@QRBG@@AAEIPAEI@Z)
    QRBG.obj : error LNK2019: unresolved external symbol _htonl@4 referenced in func
    tion "private: unsigned int __thiscall QRBG::AcquireBytesFromService(unsigned ch
    ar *,unsigned int)" (?AcquireBytesFromService@QRBG@@AAEIPAEI@Z)
    example0.exe : fatal error LNK1120: 11 unresolved externals
    
    C:\QRBG\src>
    In other news, I was able to get the Mersenne Twister PRNG (psuedo random number generator) to work. I included that in my simulation and it worked beautifully! Results were exactly as expected/calculated, which was simply a delight to see. I can't wait to share my results on the forum. But first, I really want to make the QRBG work, and compare its results with the PRNG results.

  2. #47
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    You probably wouldn't want to do both example0 and example1 at the same time, which is why example1 simply refused to compile.

    All the missing symbols are network things -- are you #include'ing winsock2.h (instead of the *nix equivalent)?

  3. #48
    Registered User
    Join Date
    May 2008
    Posts
    81
    Quote Originally Posted by tabstop View Post
    You probably wouldn't want to do both example0 and example1 at the same time, which is why example1 simply refused to compile.

    All the missing symbols are network things -- are you #include'ing winsock2.h (instead of the *nix equivalent)?
    yea I initially compiled only example0 and when that didnt work, i compiled exampe1 as well just to see if it made any difference. it didn't.

    i had initially included winsock.h. I just tried compiling it after including winsock2.h and it bombed real bad, like a gazillion errors....too many even to post.


    EDIT: winsock2 is included in qrbg.cpp. If I include it in example0 and qrbh.h also, thats when I get the gazillion errors. Also included (in qrbg.cpp) is ws2tcpip.
    Last edited by shawnt; 05-31-2008 at 01:17 PM.

  4. #49
    Registered User
    Join Date
    Jan 2005
    Posts
    7,344
    So your command line should probably be:
    Code:
    C:\QRBG\src>cl /EHsc example0.cpp QRBG.cpp
    or for example1:
    Code:
    C:\QRBG\src>cl /EHsc example1.cpp QRBG.cpp
    The errors are failures to link to socket functions. Since it is a failure to link, the problem is not the #include (that would cause compiler errors). The problem is that you need to link to the winsock library. My guess is wsock32.lib but you should really check to make sure.

    To link to that library, you can either add something to the command line or add a #pragma to the code. I don't know the exact syntax of either so you'll have to look it up, but either solution should do the trick.

  5. #50
    Registered User
    Join Date
    May 2008
    Posts
    81
    Quote Originally Posted by Daved View Post
    So your command line should probably be:
    Code:
    C:\QRBG\src>cl /EHsc example0.cpp QRBG.cpp
    or for example1:
    Code:
    C:\QRBG\src>cl /EHsc example1.cpp QRBG.cpp
    The errors are failures to link to socket functions. Since it is a failure to link, the problem is not the #include (that would cause compiler errors). The problem is that you need to link to the winsock library. My guess is wsock32.lib but you should really check to make sure.

    To link to that library, you can either add something to the command line or add a #pragma to the code. I don't know the exact syntax of either so you'll have to look it up, but either solution should do the trick.

    yea, thats exactly how I ran it on the command line.

    K, thanks for the hint on wsock32.lib. I'll look into it. I really really want to make the QRBG work. I'm kinda mad at the Croatian QRBG dudes for posting such a troublesome code, lol.

    Meanwhile, I'm really excited that I was able to make the Mersenne Twister work (thanks a bunch for the suggestion, KIBO ).

    For anyone interested, let me tell what my project was about. I wanted to simulate an activity with a large number of iterations so as to test the validity of calculated probabilities. I picked the toss of two dice. As we know, the probability distribution of the sum of twin dice tosses is a well known bell curve'ish graph (see http://en.wikipedia.org/wiki/Dice#Probability ). I wanted to test this in real life. There's something almost mystical about how theoretical probablities manifest themselves in real life (as if some invisible force is making sure that we a coin will flip heads roughly 50% of the time).

    However, I obviously don't have the time or inclination to physicaly toss a pair of dice 1000 times. So I thought about getting the computer to do it for me, and calculate and organize the results in a nice, neat, convenient format. It also made for a fun coding challange.

    It was immediately clear that I needed a random number generator much better than rand(). While googling, I ran into QRBG. And then into Mersenne from the forums. You know the rest.

    Anyway, the objectives of this project were the following, in order of interest:
    1) Simulate a probability distribution with a large number of iterations to see if actual results are in line with predicted probablities.
    2) Test the quality of the Mersenne PRNG. A good PRNG should be very unbiased, and should be able to produce results that are very close to predicted probablities.
    3) Test that simulated results increase in accuracy as number of iterations are increased.
    4) Compare results of Mersenne simulation with QRBG simulation. They should be very close.

    The last one from above is so far incomplete. Everything else was succesful.

    First, I got the Mersenne to work. That was simple. The code was online, and it was bug-free . Since the Mersenne Twister MT19937 has a period of 2^32-1, whereas I only needed a period of 6 (for each dice), I used the output of the Mersenne as the seed for srand(), and then rand() for the dice output. This worked beautfully. I later realized that I could have just used %6 + 1 on the Mersenne output, but I reasoned that using both Mersenne and srand() would increase randomness (though I'm unsure about this).

    Then, after I had finally debugged all of my code, I ran it for 10,000 iterations....and bam! The beautiful bell curve! I was blown away the first time I saw it....it was almost spiritual .

    The next part is to (hopefully) get QRBG to work. And then, I am going to extend the program to simulate and verify the solution to the Monty Hall problem (http://en.wikipedia.org/wiki/Monty_Hall_problem).

    So, if anyone made it through all that without dozing off , and if you'd like to check out the program, let me know....i'll post it.

    Ciao for now!

  6. #51
    Registered User
    Join Date
    May 2008
    Posts
    81
    ok daved, i included wsock32 lilke so:

    #pragma comment(lib, "wsock32.lib")

    and guess what???

    Code:
    C:\QRBG\src>cl /EHsc example0.cpp QRBG.cpp
    Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.21022.08 for 80x86
    Copyright (C) Microsoft Corporation.  All rights reserved.
    
    example0.cpp
    QRBG.cpp
    Generating Code...
    Microsoft (R) Incremental Linker Version 9.00.21022.08
    Copyright (C) Microsoft Corporation.  All rights reserved.
    
    /out:example0.exe
    example0.obj
    QRBG.obj
    
    C:\QRBG\src>


    but, when i run example0.exe...
    Code:
    C:\QRBG\src>example0.exe
    
    This application has requested the Runtime to terminate it in an unusual way.
    Please contact the application's support team for more information.
    
    C:\QRBG\src>
    so close but yet so far...

  7. #52
    Registered User
    Join Date
    May 2008
    Posts
    81
    here's the output for my program's dice simulation using mersenne + srand()/rand.
    Attached Images Attached Images  

  8. #53
    Registered User
    Join Date
    Jan 2005
    Posts
    7,344
    If you can get it building through the IDE I think that would help you determine the problem. VC++ has a great debugger and when an exception or other error occurs it breaks into the code and stops right about where the error occurs. Perhaps try getting it running in the IDE again.

    By the way, since your original attempt I have downloaded and tried VC++ 2008. I opened it and went to File > New > Project... Under Visual C++ in the Project types box I selected Win32. Then in the Templates box under Visual Studio installed templates I picked Win32 Console Application. I gave the project a name and hit OK. In the wizard I clicked Next, then checked the Empty Project option under Additional options. Then I clicked Finish.

    Can you try the same thing? When the project loads, right-click on the project in the Solution Explorer and select Add > Existing Item... Then in the dialog that appears select all cpp and h files you are using. Then save the project and try building it with Build Solution. If that works, then run it with F5 and it should allow you to break into the code when the error occurs.

  9. #54
    Registered User
    Join Date
    May 2008
    Posts
    81
    (runs back to the compiler)

  10. #55
    Registered User
    Join Date
    May 2008
    Posts
    81
    Seeing that a lot of my posts are made at work (sshh...), I really wish I had a compiler here.

    Anyway, the post count of the random thread was starting to creep close this one, so hence this ultra-valuable post

  11. #56
    Registered User
    Join Date
    May 2008
    Posts
    81
    Quote Originally Posted by Daved View Post
    If you can get it building through the IDE I think that would help you determine the problem. VC++ has a great debugger and when an exception or other error occurs it breaks into the code and stops right about where the error occurs. Perhaps try getting it running in the IDE again.

    By the way, since your original attempt I have downloaded and tried VC++ 2008. I opened it and went to File > New > Project... Under Visual C++ in the Project types box I selected Win32. Then in the Templates box under Visual Studio installed templates I picked Win32 Console Application. I gave the project a name and hit OK. In the wizard I clicked Next, then checked the Empty Project option under Additional options. Then I clicked Finish.

    Can you try the same thing? When the project loads, right-click on the project in the Solution Explorer and select Add > Existing Item... Then in the dialog that appears select all cpp and h files you are using. Then save the project and try building it with Build Solution. If that works, then run it with F5 and it should allow you to break into the code when the error occurs.
    Before attempting your proposed solution, I compiled example1.cpp, which was successful. But when I ran the exe, I got a 'Connect error!' (one of the exceptions defined within the cpp). This is frustrating, because it seems that the problem as the name suggests is in connecting to the service. I have sent an email to the only email id on the whole site. I hope they can provide some assistance.

    Meanwhile, I will try my luck with example0.cpp...see if I can first debug it and then get it to work. I doubt it though, given that theres a connectivity issue.


  12. #57
    Registered User
    Join Date
    May 2008
    Posts
    81
    Quote Originally Posted by Daved View Post
    If you can get it building through the IDE I think that would help you determine the problem. VC++ has a great debugger and when an exception or other error occurs it breaks into the code and stops right about where the error occurs. Perhaps try getting it running in the IDE again.

    By the way, since your original attempt I have downloaded and tried VC++ 2008. I opened it and went to File > New > Project... Under Visual C++ in the Project types box I selected Win32. Then in the Templates box under Visual Studio installed templates I picked Win32 Console Application. I gave the project a name and hit OK. In the wizard I clicked Next, then checked the Empty Project option under Additional options. Then I clicked Finish.

    Can you try the same thing? When the project loads, right-click on the project in the Solution Explorer and select Add > Existing Item... Then in the dialog that appears select all cpp and h files you are using. Then save the project and try building it with Build Solution. If that works, then run it with F5 and it should allow you to break into the code when the error occurs.
    eek, i just tried this. i got a gazillion errors...a bunch from winsock.h, a few from winsock2.h, a bunch from ws2ipdef.h, and still more from ws2tcpip.h.

    why would these headers bomb out when they were ok during the command line compilation? I created the project exactly as you said.

    EDIT: Before compiling in the command line, I would have to run vcvars32.bat from the command line (everytime), else the compiler would not be able to find any header files. could this be related?
    Last edited by shawnt; 06-14-2008 at 01:34 PM.

  13. #58
    Registered User
    Join Date
    Jan 2005
    Posts
    7,344
    You shouldn't have to run vcvars when running through the command line.

    I have no answers. Your command line is really simple, and you aren't linking to any fancy libraries (other than wsock32). I would assume your pragma on that should work for the IDE as well.

    Can you check the project properties and post the command line for the compiler and linker. An example of the errors you're getting wouldn't hurt either.

  14. #59
    Registered User
    Join Date
    May 2008
    Posts
    81
    Quote Originally Posted by Daved View Post
    You shouldn't have to run vcvars when running through the command line.

    I have no answers. Your command line is really simple, and you aren't linking to any fancy libraries (other than wsock32). I would assume your pragma on that should work for the IDE as well.

    Can you check the project properties and post the command line for the compiler and linker. An example of the errors you're getting wouldn't hurt either.
    under project properties > C/C++ > Command Line:
    Code:
    /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /Gm /EHsc /RTC1 /MDd /Fo"Debug\\" /Fd"Debug\vc90.pdb" /W3 /nologo /c /ZI /TP /errorReport:prompt
    under project properties > C/C++ > Command Line:
    Code:
    /OUT:"C:\Documents and Settings\Shar\QRBG\Debug\QRBGp.exe" /INCREMENTAL /NOLOGO /MANIFEST /MANIFESTFILE:"Debug\QRBGp.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"C:\Documents and Settings\Shar\QRBG\Debug\QRBGp.pdb" /SUBSYSTEM:CONSOLE /DYNAMICBASE /NXCOMPAT /MACHINE:X86 /ERRORREPORT:PROMPT kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
    is that what you wanted?

    and the errors:
    Code:
    1>------ Build started: Project: QRBGp, Configuration: Debug Win32 ------
    1>Compiling...
    1>qrbg.cpp
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2def.h(91) : warning C4005: 'AF_IPX' : macro redefinition
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(460) : see previous definition of 'AF_IPX'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2def.h(127) : warning C4005: 'AF_MAX' : macro redefinition
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(479) : see previous definition of 'AF_MAX'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2def.h(163) : warning C4005: 'SO_DONTLINGER' : macro redefinition
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(402) : see previous definition of 'SO_DONTLINGER'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2def.h(206) : error C2011: 'sockaddr' : 'struct' type redefinition
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(485) : see declaration of 'sockaddr'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2def.h(384) : error C2143: syntax error : missing '}' before 'constant'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2def.h(384) : error C2143: syntax error : missing ';' before 'constant'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2def.h(384) : error C2059: syntax error : 'constant'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2def.h(437) : error C2143: syntax error : missing ';' before '}'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2def.h(437) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2def.h(437) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2def.h(518) : warning C4005: 'IN_CLASSA' : macro redefinition
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(287) : see previous definition of 'IN_CLASSA'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2def.h(524) : warning C4005: 'IN_CLASSB' : macro redefinition
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(293) : see previous definition of 'IN_CLASSB'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2def.h(530) : warning C4005: 'IN_CLASSC' : macro redefinition
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(299) : see previous definition of 'IN_CLASSC'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2def.h(541) : warning C4005: 'INADDR_ANY' : macro redefinition
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(304) : see previous definition of 'INADDR_ANY'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2def.h(543) : warning C4005: 'INADDR_BROADCAST' : macro redefinition
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(306) : see previous definition of 'INADDR_BROADCAST'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2def.h(577) : error C2011: 'sockaddr_in' : 'struct' type redefinition
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(312) : see declaration of 'sockaddr_in'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(132) : error C2011: 'fd_set' : 'struct' type redefinition
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(68) : see declaration of 'fd_set'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(167) : warning C4005: 'FD_SET' : macro redefinition
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(102) : see previous definition of 'FD_SET'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(176) : error C2011: 'timeval' : 'struct' type redefinition
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(111) : see declaration of 'timeval'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(232) : error C2011: 'hostent' : 'struct' type redefinition
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(167) : see declaration of 'hostent'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(245) : error C2011: 'netent' : 'struct' type redefinition
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(180) : see declaration of 'netent'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(252) : error C2011: 'servent' : 'struct' type redefinition
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(187) : see declaration of 'servent'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(264) : error C2011: 'protoent' : 'struct' type redefinition
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(199) : see declaration of 'protoent'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(360) : error C2011: 'WSAData' : 'struct' type redefinition
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(322) : see declaration of 'WSAData'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(458) : error C2011: 'sockproto' : 'struct' type redefinition
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(494) : see declaration of 'sockproto'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(500) : error C2011: 'linger' : 'struct' type redefinition
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(531) : see declaration of 'linger'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(513) : warning C4005: 'SOMAXCONN' : macro redefinition
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(544) : see previous definition of 'SOMAXCONN'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(542) : warning C4005: 'FD_READ' : macro redefinition
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(562) : see previous definition of 'FD_READ'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(545) : warning C4005: 'FD_WRITE' : macro redefinition
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(563) : see previous definition of 'FD_WRITE'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(548) : warning C4005: 'FD_OOB' : macro redefinition
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(564) : see previous definition of 'FD_OOB'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(551) : warning C4005: 'FD_ACCEPT' : macro redefinition
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(565) : see previous definition of 'FD_ACCEPT'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(554) : warning C4005: 'FD_CONNECT' : macro redefinition
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(566) : see previous definition of 'FD_CONNECT'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(557) : warning C4005: 'FD_CLOSE' : macro redefinition
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(567) : see previous definition of 'FD_CLOSE'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(1527) : error C2375: 'accept' : redefinition; different linkage
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(735) : see declaration of 'accept'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(1548) : error C2375: 'bind' : redefinition; different linkage
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(740) : see declaration of 'bind'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(1567) : error C2375: 'closesocket' : redefinition; different linkage
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(745) : see declaration of 'closesocket'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(1586) : error C2375: 'connect' : redefinition; different linkage
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(747) : see declaration of 'connect'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(1607) : error C2375: 'ioctlsocket' : redefinition; different linkage
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(752) : see declaration of 'ioctlsocket'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(1628) : error C2375: 'getpeername' : redefinition; different linkage
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(757) : see declaration of 'getpeername'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(1649) : error C2375: 'getsockname' : redefinition; different linkage
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(762) : see declaration of 'getsockname'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(1672) : error C2375: 'getsockopt' : redefinition; different linkage
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(767) : see declaration of 'getsockopt'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(1693) : error C2375: 'htonl' : redefinition; different linkage
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(774) : see declaration of 'htonl'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(1710) : error C2375: 'htons' : redefinition; different linkage
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(776) : see declaration of 'htons'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(1728) : error C2375: 'inet_addr' : redefinition; different linkage
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(778) : see declaration of 'inet_addr'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(1745) : error C2375: 'inet_ntoa' : redefinition; different linkage
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(780) : see declaration of 'inet_ntoa'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(1763) : error C2375: 'listen' : redefinition; different linkage
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(782) : see declaration of 'listen'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(1781) : error C2375: 'ntohl' : redefinition; different linkage
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(786) : see declaration of 'ntohl'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(1798) : error C2375: 'ntohs' : redefinition; different linkage
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(788) : see declaration of 'ntohs'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(1818) : error C2375: 'recv' : redefinition; different linkage
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(790) : see declaration of 'recv'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(1843) : error C2375: 'recvfrom' : redefinition; different linkage
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(796) : see declaration of 'recvfrom'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(1869) : error C2375: 'select' : redefinition; different linkage
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(804) : see declaration of 'select'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(1893) : error C2375: 'send' : redefinition; different linkage
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(811) : see declaration of 'send'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(1918) : error C2375: 'sendto' : redefinition; different linkage
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(817) : see declaration of 'sendto'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(1944) : error C2375: 'setsockopt' : redefinition; different linkage
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(825) : see declaration of 'setsockopt'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(1966) : error C2375: 'shutdown' : redefinition; different linkage
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(832) : see declaration of 'shutdown'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(1986) : error C2375: 'socket' : redefinition; different linkage
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(836) : see declaration of 'socket'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(2009) : error C2375: 'gethostbyaddr' : redefinition; different linkage
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(843) : see declaration of 'gethostbyaddr'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(2029) : error C2375: 'gethostbyname' : redefinition; different linkage
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(848) : see declaration of 'gethostbyname'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(2047) : error C2375: 'gethostname' : redefinition; different linkage
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(850) : see declaration of 'gethostname'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(2067) : error C2375: 'getservbyport' : redefinition; different linkage
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(854) : see declaration of 'getservbyport'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(2087) : error C2375: 'getservbyname' : redefinition; different linkage
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(858) : see declaration of 'getservbyname'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(2106) : error C2375: 'getprotobynumber' : redefinition; different linkage
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(862) : see declaration of 'getprotobynumber'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(2124) : error C2375: 'getprotobyname' : redefinition; different linkage
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(864) : see declaration of 'getprotobyname'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(2145) : error C2375: 'WSAStartup' : redefinition; different linkage
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(868) : see declaration of 'WSAStartup'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(2163) : error C2375: 'WSACleanup' : redefinition; different linkage
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(872) : see declaration of 'WSACleanup'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(2180) : error C2375: 'WSASetLastError' : redefinition; different linkage
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(874) : see declaration of 'WSASetLastError'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(2197) : error C2375: 'WSAGetLastError' : redefinition; different linkage
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(876) : see declaration of 'WSAGetLastError'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(2214) : error C2375: 'WSAIsBlocking' : redefinition; different linkage
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(878) : see declaration of 'WSAIsBlocking'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(2231) : error C2375: 'WSAUnhookBlockingHook' : redefinition; different linkage
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(880) : see declaration of 'WSAUnhookBlockingHook'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(2248) : error C2375: 'WSASetBlockingHook' : redefinition; different linkage
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(882) : see declaration of 'WSASetBlockingHook'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(2265) : error C2375: 'WSACancelBlockingCall' : redefinition; different linkage
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(884) : see declaration of 'WSACancelBlockingCall'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(2287) : error C2375: 'WSAAsyncGetServByName' : redefinition; different linkage
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(886) : see declaration of 'WSAAsyncGetServByName'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(2314) : error C2375: 'WSAAsyncGetServByPort' : redefinition; different linkage
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(894) : see declaration of 'WSAAsyncGetServByPort'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(2340) : error C2375: 'WSAAsyncGetProtoByName' : redefinition; different linkage
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(902) : see declaration of 'WSAAsyncGetProtoByName'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(2365) : error C2375: 'WSAAsyncGetProtoByNumber' : redefinition; different linkage
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(909) : see declaration of 'WSAAsyncGetProtoByNumber'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(2390) : error C2375: 'WSAAsyncGetHostByName' : redefinition; different linkage
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(916) : see declaration of 'WSAAsyncGetHostByName'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(2417) : error C2375: 'WSAAsyncGetHostByAddr' : redefinition; different linkage
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(923) : see declaration of 'WSAAsyncGetHostByAddr'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(2440) : error C2375: 'WSACancelAsyncRequest' : redefinition; different linkage
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(932) : see declaration of 'WSACancelAsyncRequest'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(2461) : error C2375: 'WSAAsyncSelect' : redefinition; different linkage
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(934) : see declaration of 'WSAAsyncSelect'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(3910) : error C2059: syntax error : '}'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(3910) : error C2143: syntax error : missing ';' before '}'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\winsock2.h(3910) : error C2059: syntax error : '}'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2ipdef.h(39) : error C2143: syntax error : missing ';' before '{'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2ipdef.h(39) : error C2447: '{' : missing function header (old-style formal list?)
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2ipdef.h(119) : warning C4005: 'IP_TOS' : macro redefinition
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(352) : see previous definition of 'IP_TOS'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2ipdef.h(120) : warning C4005: 'IP_TTL' : macro redefinition
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(351) : see previous definition of 'IP_TTL'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2ipdef.h(121) : warning C4005: 'IP_MULTICAST_IF' : macro redefinition
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(346) : see previous definition of 'IP_MULTICAST_IF'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2ipdef.h(122) : warning C4005: 'IP_MULTICAST_TTL' : macro redefinition
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(347) : see previous definition of 'IP_MULTICAST_TTL'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2ipdef.h(123) : warning C4005: 'IP_MULTICAST_LOOP' : macro redefinition
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(348) : see previous definition of 'IP_MULTICAST_LOOP'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2ipdef.h(124) : warning C4005: 'IP_ADD_MEMBERSHIP' : macro redefinition
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(349) : see previous definition of 'IP_ADD_MEMBERSHIP'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2ipdef.h(125) : warning C4005: 'IP_DROP_MEMBERSHIP' : macro redefinition
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(350) : see previous definition of 'IP_DROP_MEMBERSHIP'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2ipdef.h(126) : warning C4005: 'IP_DONTFRAGMENT' : macro redefinition
    1>        c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(353) : see previous definition of 'IP_DONTFRAGMENT'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2tcpip.h(750) : error C2061: syntax error : identifier 'MULTICAST_MODE_TYPE'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2tcpip.h(757) : error C2065: 'PIP_MSFILTER' : undeclared identifier
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2tcpip.h(757) : error C2146: syntax error : missing ';' before identifier 'Filter'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2tcpip.h(757) : error C2065: 'Filter' : undeclared identifier
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2tcpip.h(759) : error C2065: 'SourceCount' : undeclared identifier
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2tcpip.h(760) : error C2065: 'Filter' : undeclared identifier
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2tcpip.h(760) : error C2070: ''unknown-type'': illegal sizeof operand
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2tcpip.h(760) : error C2065: 'SourceList' : undeclared identifier
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2tcpip.h(760) : error C2070: ''unknown-type'': illegal sizeof operand
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2tcpip.h(761) : error C3861: 'WSASetLastError': identifier not found
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2tcpip.h(765) : error C2065: 'IP_MSFILTER' : undeclared identifier
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2tcpip.h(765) : error C2070: ''unknown-type'': illegal sizeof operand
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2tcpip.h(765) : error C2065: 'SourceCount' : undeclared identifier
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2tcpip.h(766) : error C2065: 'Filter' : undeclared identifier
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2tcpip.h(766) : error C2065: 'PIP_MSFILTER' : undeclared identifier
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2tcpip.h(766) : error C2146: syntax error : missing ';' before identifier 'HeapAlloc'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2tcpip.h(767) : error C2065: 'Filter' : undeclared identifier
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2tcpip.h(768) : error C3861: 'WSASetLastError': identifier not found
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2tcpip.h(772) : error C2065: 'Filter' : undeclared identifier
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2tcpip.h(772) : error C2227: left of '->imsf_multiaddr' must point to class/struct/union/generic type
    1>        type is ''unknown-type''
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2tcpip.h(773) : error C2065: 'Filter' : undeclared identifier
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2tcpip.h(773) : error C2227: left of '->imsf_interface' must point to class/struct/union/generic type
    1>        type is ''unknown-type''
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2tcpip.h(774) : error C2065: 'Filter' : undeclared identifier
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2tcpip.h(774) : error C2227: left of '->imsf_fmode' must point to class/struct/union/generic type
    1>        type is ''unknown-type''
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2tcpip.h(774) : error C2065: 'FilterMode' : undeclared identifier
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2tcpip.h(775) : error C2065: 'Filter' : undeclared identifier
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2tcpip.h(775) : error C2227: left of '->imsf_numsrc' must point to class/struct/union/generic type
    1>        type is ''unknown-type''
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2tcpip.h(775) : error C2065: 'SourceCount' : undeclared identifier
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2tcpip.h(776) : error C2065: 'SourceCount' : undeclared identifier
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2tcpip.h(778) : error C2065: 'Filter' : undeclared identifier
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2tcpip.h(778) : error C2227: left of '->imsf_slist' must point to class/struct/union/generic type
    1>        type is ''unknown-type''
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2tcpip.h(778) : error C2065: 'SourceList' : undeclared identifier
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2tcpip.h(778) : error C2065: 'SourceCount' : undeclared identifier
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2tcpip.h(778) : error C2065: 'SourceList' : undeclared identifier
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2tcpip.h(778) : error C2070: ''unknown-type'': illegal sizeof operand
    1>c:\program files\microsoft sdks\windows\v6.0a\include\ws2tcpip.h(778) : fatal error C1003: error count exceeds 100; stopping compilation
    1>Build log was saved at "file://c:\Documents and Settings\Shar\QRBG\QRBG\Debug\BuildLog.htm"
    1>QRBGp - 104 error(s), 24 warning(s)
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

  15. #60
    Registered User
    Join Date
    May 2008
    Posts
    81
    I know its a handful, but I'm desparate.

Page 4 of 5 FirstFirst 12345 LastLast
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. problem with random number generator
    By Niss in forum C Programming
    Replies: 6
    Last Post: 10-01-2008, 07:03 PM
  2. Replies: 1
    Last Post: 09-04-2007, 06:31 AM
  3. Random card generator
    By Loic in forum C++ Programming
    Replies: 13
    Last Post: 08-11-2007, 03:28 PM
  4. Random number generator between 0 and 1
    By Lord CyKill in forum C# Programming
    Replies: 1
    Last Post: 03-29-2007, 09:03 AM
  5. Fast normal random number generator
    By testing123 in forum C++ Programming
    Replies: 2
    Last Post: 08-17-2006, 11:01 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21