View RSS Feed

Ligerleon89

C++ clustercuss

Rate this Entry
Now for the most part, I've been practicing as much as I could with C++ as far as I know it. Using the same compiler (DEV-C++) since 2 years ago. Now I'm having already mixed feelings about that compiler as it seems to be having problems, despite the fact that it seems I never had a problem with that thing before.

I can't fathom why, but after various complaints from other programmer users and such, Man what a problem Dev C++ is. And I'm so close making an executable file for my little practice project just to get my cooking up for some real challenge. I'm just doing a program of your usual algerbra/geometry. pretty much the Area and Circumference of the Circle. I just put in the necessary codes I needed to make it work. The last time I tried I forget to make dare sure that not only the files I created are in a project file, but I have to separately compile each file in that compilation. Then use the object codes from the complied files and link and build them together to make an .exe file which was what I was trying to do from the start back then, but I ended up rushing through the whole thing and I forget that extra important detail.

Now in the midst of all this, I can't seem to get my files to build and compile and link into the exccutable code. I checked everything, made sure each file was not full of errors, and were properly linked and ready to build. But it seems there's no build function, I don't know for the most part all I need was to object codes to the files which I have and even when I got everything together I get a freaking build error meaning I need to build the project somehow, but I don't know where that option is.

Then I had to go and find out what the heck was wrong with it only to find previous complaints of Dev C++ having major issue. And from the looks of the numbers of how many bugs and crud were in there. THERE..IS..A..LOT!. About over 300 bugs and glitches. So not only that it seems the complier I'm using doesn't have a build option, but trying to work on a complier that could possibly crash my computer was a worry that was now just right up there in my brain.

Well I'm almost done with my practice files but I need to make sure that all my files can get those object codes so I can turn them into a .exe. And I have two issues that are blocking it.
Well I'm already considering getting Microsoft Visual Studio C++ compiler and CodeBlocks and use either of the two to use for my programs from now on.

Well that's my gripe for this blog, thing is I don't need any much problems knowing that I'm 3 classes alway right now from getting my associates. and I have to admit I can be stubborn as Dad, but I rather not try to elaborate on that. At least I know that I have some problems and I have to fix it before Wednesday since I got my first program assignment.

Comments

  1. Dark Pulse's Avatar
    It could be worse - you could be a judge for the International Obfuscated C Code Contest, where not only do people write purposely stupefying code (like figuring out the area of a circle by literally calculating the area of a circle in the code itself) but will get awards like "Worst Abuse of the Rules" (considered a high honor, especially if the judges change the rules).

    An example of that: Someone wrote "The world's smallest self-replicating C Program." The sourcecode file is 100% empty. When compiled, it made a zero-byte program, that successfully ran and displayed absolutely nothing - thus fulfilling exactly what it said it would do.

    As the judges said:
    While strictly speaking, smr.c is not a valid C program, it is not an invalid C program either! Some C compilers will compile an empty file into a program that does nothing. But even if your compiler can't, the build instructions supplied with this entry will produce an executable file. On most systems, the stdout from the executable will exactly match original source.
    They changed the rules so the minimum compiled size had to be at least one byte.
  2. Enhance's Avatar
    ^ Don't see how it relates, but it's a nice contest to check out. It wasn't really about "stupefying" code, but more "obfuscating" - making it difficult to read, so it's hard to tell what program does before running. Like here's BASIC compiler/interpreter:
    Code

    Code:
    #include <stdio.h>
    #define Q r=R[*p++-'0'];while(
    #define B ;break;case
    char*s="Qjou!s\\311^-g\\311^-n\\311^-c\\::^-q-ma%mO1JBHm%BQ-aP1J[O1HB%[Q<nbj\
    o)*|gps)<<*txjudi)m*|aQdbtf!::::;sfuvso<aQefgbvmu;aQ<m,,a%CQ<csfbla%bQ<aN2!Q\
    \ndbtf!aP2Q;m>aP2Q<a%!D12J!JGJHJOJQJFJSJJJMHS%HD12D12N3!N4\nJUJT%UQm>aP4HC%T\
    Qs\\q,,^>m,2<m>aP4HC%SD12N1\nJNQm>s\\..q^aHC%NHb%GN1!D32P3%RN1UP1D12JPQUaP1H\
    R%PN4\nQ<g\\(aP3Q(^>aP2Q,2<n\\(aP3Q(^>aP4Hb%OD12D12N2!N3\nJVP3Q,,<jg)aP3Q=>n\
    \\(aP3Q(^*m>g\\(aP3Q(^<fmtf!m,,aHC%QN1!N1\nJ#Qqsjoug)#&e]o#-aP1Q*aHb%#Qqvut)\
    aP1Q*aHb%FN1\nQm>::::aHC%VP3Q>bupj)hfut)c**aHb%JD12JON1!Qjg)a%LN1UP1D12JIQUa\
    P1HL%IQ*m>aN2!N2\nP2Q<fmtf!m,,aHC%MN1!N2>P2Q>aN2\nP2Hbdd!b/d";k;char R[4][99]
    ;main(c,v)char**v;{char*p,*r,*q;for(q=s;*q;q++)*q>' '&&(*q)--;{FILE*i=fopen(v
    [1],"r"),*o=fopen(q-3,"w");for(p=s;;p++)switch(*p++){B'M':Q(k=fgetc(i))!=EOF
    &&k!=*p)*r++=k;if(k==EOF){fputs("}}\n",o);fclose(o);return system(q-6);}*r=0
    B'P':while(*p!='`')fputc(*p++,o)B'O':Q*r)fputc(*r++,o);p--B'C':k=0;Q k<*p-'0'
    )(*r++=fgetc(i),k++);*r=0 B'I':k= *p;if(**R==k)goto G B'G':k= *p;G:p=s;while(
    *p!='$'||p[1]!= k)p++;p++B'N':R[*p-'0'][0]++;}}}

    As of abuses of the rules, there was once a contest between students to make a fastest program to do some actions with a file (I don't remember what actions, but let's say it's some matrix calculations).
    Third place was about 9 seconds time - a guy did an optimized algorithm of that calculation.
    Second place was about 1 second - since programs were ran on a same machine and submissions were unlimited, a guy first sent a program that made result and saved it to hard disk there, and then sent a program that copied the file.
    First place was... -3 seconds, the guy altered unix system clock after finishing the task.
    Contest was annulled.... for some reason

    As for your problem, with VS(C++) you won't need to build separate files into object data then link them, it's done for you. Though surely enough it also has its bugs and glitches, they're not so vital (and it's under development). Con would be that it's not cross-platform. (it's MS, what would you expect)
    Updated September 11th, 2012 at 05:49 AM by Enhance
  3. Dark Pulse's Avatar
    Well, not all of them are obfuscated. Some do little tricks. There's a flight simulator, where the dev took the painstaking time to make the code into the shape of an airplane.

    And I did mention the "calculating a circle by the size of a circle in the code":

    Code:
    #define _ -F<00||--F-OO--; int F=00,OO=00;main(){F_OO();printf("%1.3f\n",4.*-F/OO/OO);}F_OO()
     {
                 _-_-_-_
            _-_-_-_-_-_-_-_-_
         _-_-_-_-_-_-_-_-_-_-_-_
       _-_-_-_-_-_-_-_-_-_-_-_-_-_
      _-_-_-_-_-_-_-_-_-_-_-_-_-_-_
      _-_-_-_-_-_-_-_-_-_-_-_-_-_-_
     _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
     _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
     _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
     _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
      _-_-_-_-_-_-_-_-_-_-_-_-_-_-_
      _-_-_-_-_-_-_-_-_-_-_-_-_-_-_
       _-_-_-_-_-_-_-_-_-_-_-_-_-_
         _-_-_-_-_-_-_-_-_-_-_-_
             _-_-_-_-_-_-_-_ 
                _-_-_-_
     }
    So yeah... there's some real winners in there.
  4. Enhance's Avatar
    The original contest was contest of "obfuscation" (See its name - IOCCC). Later, of course, they became bored with just this - so they started trying to do more fun things, like shaping or in other ways fucking with preprocessor.
    Also, the code you just pasted is obfuscated too - it's not obvious what program does before you launch it/spend load of time thinking. (Same would go for the flight simulator)
  5. Dark Pulse's Avatar
    Quote Originally Posted by Enhance
    The original contest was contest of "obfuscation" (See its name - IOCCC). Later, of course, they became bored with just this - so they started trying to do more fun things, like shaping or in other ways fucking with preprocessor.
    Also, the code you just pasted is obfuscated too - it's not obvious what program does before you launch it/spend load of time thinking. (Same would go for the flight simulator)
    It's obfuscated, yes, but the stupefying part comes from how it calculates the circle. That sort of "Why would you ever do this?!" thing.
  6. Ligerleon89's Avatar
    Well i finished my program finally, turns out that my compiler on my laptop was incorrectly installed, and I left just about two errors that I fixed easily. Program works like a charm.