Compiler Problem

This is a discussion on Compiler Problem within the C++ Programming forums, part of the General Programming Boards category; I'm not very good at programming, despite having been working on it for more than a year. I was reading ...

  1. #1
    Registered User
    Join Date
    Sep 2005
    Posts
    7

    Compiler Problem

    I'm not very good at programming, despite having been working on it for more than a year. I was reading through the tutorials on this site, and tried copying and pasting a bit of code from the pointers tutorial (which I don't understand as well as I would like). I tried to compile it and got no errors, but Dev C++ refused to run the program. I noticed that the linker tab was highlighted, so I clicked on it, and it gave me this:

    dlltool: Unable to open object file: C:\documents and settings\user\desktop\programs\Pointer Program\Pointer Program1.o
    Warning: No export definition file provided
    dllwrap will create one, but may not be what you want
    C:\DEV-C_~1\Bin\dllwrap: dlltool exited with status 1
    It did this with another program I wrote today to test if a Random Number Generator could be seeded by adding 1 to the seed and still produce random results. The idea behind this was to reseed the RNG faster than the 1 second intervals using the system clock, because I've made several programs that have problems with repeating the same number because the clock hasn't changed yet.

    Anyways, can anyone explain why I get this error and how to fix it? Help on pointers would be welcome too.
    Last edited by Redattack34; 09-05-2005 at 12:27 AM.

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,668
    Looks like you created a library project rather than a console project.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    ZuK
    ZuK is offline
    Registered User
    Join Date
    Aug 2005
    Location
    Austria
    Posts
    1,990
    Quote Originally Posted by Redattack34
    It did this with another program I wrote today to test if a Random Number Generator could be seeded by adding 1 to the seed and still produce random results. The idea behind this was to reseed the RNG faster than the 1 second intervals using the system clock, because I've made several programs that have problems with repeating the same number because the clock hasn't changed yet.
    You should not reseed the random generator. Use srand only once in a program.
    Kurt

  4. #4
    Registered User
    Join Date
    Sep 2005
    Posts
    1
    Hey i've got about the same problem as you.
    I started compiling and running the example programs here and couldn't get a single one to work.
    They all don't show any errors but when I try running the window it should show it in pops up for a sec then closes.
    Anyone know what i'm doing wrong here? I'm using Dev-C++ too and examples from other websites work. *shrug*

  5. #5
    ZuK
    ZuK is offline
    Registered User
    Join Date
    Aug 2005
    Location
    Austria
    Posts
    1,990
    @ToxicCROSSFIRE: Run the program from the commandline.
    There are other "solutions" for that "problem". Use the forum search function.

  6. #6
    Registered User
    Join Date
    Sep 2005
    Posts
    7
    Oh. Thats odd. If you only seed the RNG once wouldn't it keep giving the same result? I know most of the programs I have that include the RNG code have it as part of a loop to keep it random. Is there any way around how the RNG will give the same results multiple times in a row if the system clock hasnt changed yet? As for the library project thing, I'll check it out. As for your problem, ToxicCrossfire, I suggest a user input at the end to keep the program open, as it isnt actually finished yet. There are other (better) solutions though. You arent having the same problem as far as I can tell, as my Dev C++ has the execute button greyed out in the compile window, and does nothing if I click it on the toolbar.
    Last edited by Redattack34; 09-05-2005 at 02:39 PM.

  7. #7
    Registered User
    Join Date
    Nov 2002
    Posts
    491
    I'd suggest reading the Dev-C++ documentation for your window-closing problem.
    You might have found:
    http://www.bloodshed.net/faq.html#2

  8. #8
    ZuK
    ZuK is offline
    Registered User
    Join Date
    Aug 2005
    Location
    Austria
    Posts
    1,990
    You seed the RNG only once. By Seeding you give the RNG a startvalue. The same startvalue gives you the same sequence.
    Kurt

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Dev-C++ compiler problem
    By GrasshopperEsq in forum C++ Programming
    Replies: 19
    Last Post: 05-08-2008, 02:35 AM
  2. Compiler Problem
    By sitestem in forum C++ Programming
    Replies: 2
    Last Post: 04-11-2004, 03:48 PM
  3. Replies: 5
    Last Post: 12-03-2003, 04:47 PM
  4. Problem with compiler
    By knight543 in forum C++ Programming
    Replies: 4
    Last Post: 02-09-2002, 08:16 PM
  5. Please help me with this compiler problem
    By incognito in forum C++ Programming
    Replies: 1
    Last Post: 01-05-2002, 04:14 PM

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