468,497 Members | 1,869 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,497 developers. It's quick & easy.

ld returned 1 exit status, cannot find -lobjc

In the title are the two errors I get when compiling. The code is as follows

Expand|Select|Wrap|Line Numbers
  1. int main()
  2. {
  3.  
  4.  int runs;
  5.  double high=0;
  6.  double remaining=0;
  7.  double fremaining=0;
  8.  int count=0; // count the # of times we reach out goal
  9.  int progress=0;
  10.  int h,r;
  11.  srand((unsigned)time(NULL)); // seed random # generator
  12.  printf("[....................]");
  13.  for (runs=0;runs<NUMRUNS;runs++)
  14.  {
  15.   if (20*(runs+1)/NUMRUNS>progress)
  16.   {
  17.    progress=20*(runs+1)/NUMRUNS;
  18.    printf("\r[");
  19.    for(int x=0;x<progress;x++)
  20.     printf("*");
  21.   }
  22.   start(h,r);
  23.   high+=h;
  24.   remaining+=r/NUMRUNS; // Compute a running average of remaining meat
  25.   if (r>=GOALMONEY)
  26.    count++;
  27.   else
  28.    fremaining+=r;
  29.  }
  30.  high/=NUMRUNS;
  31.  if (NUMRUNS-count>0)
  32.   fremaining/=NUMRUNS-count;
  33.  printf("\n\nStarted with %dk. ",STARTINGMONEY/1000);
  34.  if (GOALMONEY>0)
  35.   printf("Set a goal of %dk. ",GOALMONEY/1000);
  36.  printf("Ran %d times.\nGot up to an average %dk.\nEnded up with an average %dk.\n",NUMRUNS,int(high/1000),int(remaining/1000));
  37.  if (GOALMONEY>0)
  38.  {
  39.   if (NUMRUNS-count>0)
  40.    printf("Failures ended up with an average %dk.\n",int(fremaining/1000));
  41.   printf("You reached your goal %f%% of the time.\n\n",(100*double(count)/NUMRUNS));
  42.  }
  43.  system("pause");
  44. return 0;
  45. }
  46.  
  47.  
Thanks for any help that can be given.
Feb 25 '08 #1
3 5680
hsn
237 100+
i myself will not read a 115 line of code to find the error.
you have to explain your code a little bit, try to find where the error is happening so we can help you.
explain the problem if you can.

regrads
hsn
Feb 25 '08 #2
weaknessforcats
9,207 Expert Mod 8TB
Not a clue. Your code compiles and links using Visual Studio.NET 2005.

However, this tool creates the makefile. If you have one of the others where you need to write your own makefile, then there may be an error there.
Feb 25 '08 #3
Found the problem. Switched from Dev-CPP to digital mas compiler and it was fixed. THanks, all.
Feb 26 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by Jari Aalto+usenet | last post: by
2 posts views Thread by Adam | last post: by
3 posts views Thread by learning_C++ | last post: by
2 posts views Thread by Jeffrey W. Baker | last post: by
2 posts views Thread by Navaneet | last post: by
9 posts views Thread by TsanChung | last post: by
2 posts views Thread by babhishek | last post: by
reply views Thread by NPC403 | last post: by
3 posts views Thread by gieforce | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.