• Lucid Dreaming - Dream Views




    Results 1 to 25 of 165

    Hybrid View

    1. #1
      Banned
      Join Date
      Apr 2007
      Location
      Out Chasing Rabbits
      Posts
      15,193
      Likes
      935
      Quote Originally Posted by slayer View Post
      How to I package together my code into an exe or something both windows and macs can open?
      A dos console and unix consoles are completely different. Macs can run windows console programs, you need to compile seperately for mac and windows

    2. #2
      Gentlemen. Ladies. slayer's Avatar
      Join Date
      Mar 2007
      Gender
      Location
      Right here... Reputation: 9999
      Posts
      4,902
      Likes
      473
      DJ Entries
      4
      Quote Originally Posted by ninja9578 View Post
      A dos console and unix consoles are completely different. Macs can run windows console programs, you need to compile seperately for mac and windows
      Then how do I do it just for windows?

    3. #3
      Banned
      Join Date
      Apr 2007
      Location
      Out Chasing Rabbits
      Posts
      15,193
      Likes
      935
      Quote Originally Posted by slayer View Post
      Then how do I do it just for windows?
      It does that for you

      Go to the folder with your Code::Blocks file, then go to bin/Debug. A .exe file should be in there

      If you use standard C++, it will compile on any platform with no change in code Firefox compiles on every major platform, using the same code, with very little preprocessor.
      Last edited by ninja9578; 01-13-2010 at 03:23 AM.

    4. #4
      A Natural The Invisible Man's Avatar
      Join Date
      Nov 2008
      Gender
      Posts
      365
      Likes
      8
      "C++ will let you shoot your foot without warning you. In fact, it will even load the gun for you."

      ~ Allegro User


      Can you see me now?

    5. #5
      Ex Tech Admin Achievements:
      Created Dream Journal Tagger First Class Veteran First Class 10000 Hall Points Populated Wall Referrer Gold Made lots of Friends on DV
      slash112's Avatar
      Join Date
      Nov 2008
      Gender
      Location
      Sunny Scotland
      Posts
      5,113
      Likes
      1567
      DJ Entries
      29
      Ynot. I'll give you an example. If the program asks you to input something, you would put it in. You would get an instant response, and then the terminal window would instantly shut the moment after the new text is displayed. This is not what you want.

      It's not that I need it at this level, I don't need any fancy way of closing the program at this level. It is just purely for having it there.

    6. #6
      khh
      khh is offline
      Remember Achievements:
      1000 Hall Points Veteran First Class
      khh's Avatar
      Join Date
      Jun 2009
      Gender
      Location
      Norway
      Posts
      2,482
      Likes
      1309
      Quote Originally Posted by ninja9578 View Post
      If you use standard C++, it will compile on any platform with no change in code Firefox compiles on every major platform, using the same code, with very little preprocessor.
      There are a lot of things you need system calls for, though, like GUI and scanning directories and such. So Firefox must be using preprocessor directives, or libraries which uses them.

      Quote Originally Posted by slash112 View Post
      Ynot. I'll give you an example. If the program asks you to input something, you would put it in. You would get an instant response, and then the terminal window would instantly shut the moment after the new text is displayed. This is not what you want.
      Console programs are normally opened from the terminal, though. And if you do that, then the terminal doesn't close and you'll see the output. It's just if you open it by double clicking on the executable that you won't see the text, but then that's no how the programs are supposed to work. If you want those kinds of programs you need GUI.

      Funny thing, I've got C++ as a university subject this year. Of the things we'll learn this year, there was only one thing I haven't done before.
      April Ryan is my friend,
      Every sorrow she can mend.
      When i visit her dark realm,
      Does it simply overwhelm.

    7. #7
      Banned
      Join Date
      Apr 2007
      Location
      Out Chasing Rabbits
      Posts
      15,193
      Likes
      935
      Quote Originally Posted by khh View Post
      There are a lot of things you need system calls for, though, like GUI and scanning directories and such. So Firefox must be using preprocessor directives, or libraries which uses them.
      I said little preprocessor. I've looked at the Firefox code because I reverse engineered a chunk of it. All of this stuff uses a NPWindow object, almost all of the preprocessor is in there.

      Console programs are normally opened from the terminal, though. And if you do that, then the terminal doesn't close and you'll see the output. It's just if you open it by double clicking on the executable that you won't see the text, but then that's no how the programs are supposed to work. If you want those kinds of programs you need GUI.
      But stick with the terminal while learning, GUIs can be a pain.

      Funny thing, I've got C++ as a university subject this year. Of the things we'll learn this year, there was only one thing I haven't done before.
      But I'm sure that you'll learn better technique and optimization techniques that you currently don't know. Assuming the professor is competent, I had a professor in college who was a good C++ programmer in 1995, but he stuck to those techniques, so we were taught no modern designs. C++ coding changes very quickly, if you don't stay on top of it, you can fall behind quickly.

    8. #8
      Ex Tech Admin Achievements:
      Created Dream Journal Tagger First Class Veteran First Class 10000 Hall Points Populated Wall Referrer Gold Made lots of Friends on DV
      slash112's Avatar
      Join Date
      Nov 2008
      Gender
      Location
      Sunny Scotland
      Posts
      5,113
      Likes
      1567
      DJ Entries
      29
      I can't wait till I get to GUIs. That will be kick ass.

    9. #9
      Banned
      Join Date
      Apr 2007
      Location
      Out Chasing Rabbits
      Posts
      15,193
      Likes
      935
      C++ is a nightmare with GUIs because the language isn't designed for it. I just spent 3 full workdays creating a frame, a dynamic set of menus, a status bar, and a web preferences pane.

      Luckily, there are graphical ways to do it in 5 minutes, which is what I recommend using when starting out. The only reason I don't use that is because I need more control over them.

    10. #10
      khh
      khh is offline
      Remember Achievements:
      1000 Hall Points Veteran First Class
      khh's Avatar
      Join Date
      Jun 2009
      Gender
      Location
      Norway
      Posts
      2,482
      Likes
      1309
      Quote Originally Posted by ninja9578 View Post
      I said little preprocessor. I've looked at the Firefox code because I reverse engineered a chunk of it. All of this stuff uses a NPWindow object, almost all of the preprocessor is in there.
      Ah, okai.

      Quote Originally Posted by ninja9578 View Post
      But stick with the terminal while learning, GUIs can be a pain.
      Yeah, I know. I tried learning GUI a while back, but I simply gave up on it for a while. I didn't have a clue about what I was doing, or what the code elements meant or anything. Figured I'd just write a console program with some of the same functionality and port it when I was ready :p


      Quote Originally Posted by ninja9578 View Post
      But I'm sure that you'll learn better technique and optimization techniques that you currently don't know. Assuming the professor is competent, I had a professor in college who was a good C++ programmer in 1995, but he stuck to those techniques, so we were taught no modern designs. C++ coding changes very quickly, if you don't stay on top of it, you can fall behind quickly.
      Yeah, I hope so. There must be things I've missed, since I've mostly thought myself what I know. But I think he must be a good programmer, he's taught that specific course for the two year it's run, and he taught the Java course the engineers attended instead. He ought to be good by now.
      April Ryan is my friend,
      Every sorrow she can mend.
      When i visit her dark realm,
      Does it simply overwhelm.

    11. #11
      Banned
      Join Date
      Apr 2007
      Location
      Out Chasing Rabbits
      Posts
      15,193
      Likes
      935
      Good Java Programmer != Good C++ Programmer, very different designs.

      Also, almost all of your functionality can be done using the console. I'm currently tearing apart an application so that the functionality is completely disjoint for the main window. The window runs by itself and loads the functionality as a dll.
      Last edited by ninja9578; 01-13-2010 at 07:06 PM.

    12. #12
      FBI agent Ynot's Avatar
      Join Date
      Oct 2005
      Gender
      Location
      Southend, Essex
      Posts
      4,337
      Likes
      14
      Quote Originally Posted by slash112 View Post
      system("PAUSE") means that when I run the program, it doesn't close as soon as it finishes. But it lets you close it by pressing any key.
      Don't do that
      I'm not sure exactly what you mean by "closing" (you mean the terminal window?)
      but good programs finish as soon as they're done, and do not hang for user input unnecessarily

      Say you release a program that takes input from stdin does something and outputs to stdout, exiting 0 on success and any other value on error, errors get sent to stderr

      I would like to be able to say something like

      Code:
      slash112_program || echo "Error $?"
      or
      Code:
      cat some_file | slash112_program | less
      hanging the program for input at the end breaks program flow
      anyway....

      Quote Originally Posted by slayer View Post
      How to I package together my code into an exe or something both windows and macs can open?
      You can't (well, you can, but it's way more trouble than it's worth)
      Either make the various platform & architecture packages yourself
      or the easy route - just release the code
      If the program's useful, people will package it up for their platform / architecture of choice
      (\_ _/)
      (='.'=)
      (")_(")

    Bookmarks

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •