Results 1 to 10 of 31

Thread: Problem with FreePascal + MacOS

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Quote Originally Posted by Relfos
    I don't know what a 'Bundle' is, I'll read about it, but for now just a simple console application should run.
    About "Bundle" I remembered because of your problem with "my program still brings up a console".

    Tomorrow, I will try to create a application from scratch that reproduces the error, without using the engine.
    Sometimes starting something from scratch is better then trying to modify something huge Good luck with your experiments.

  2. #2
    I'm having no luck finding what a bundle is. When I talked about that, was about the {$APPTYPE CONSOLE} and {$APPTYPE GUI}, I'm using the later, and from what I read it is supported on darwin, however, when I double click the executable, a console window opens.

    Another thing I remembered now, maybe I'm compiling for 64bits?
    All other ports I have done are 32bits, and the code itself uses lots of pointer hacks that would probably crash under 64bits.
    How to compile a 32bits application under snow leopard, is that even possible?
    Last edited by Relfos; 02-02-2011 at 11:48 PM.

  3. #3
    Passing the -Wb compiler switch will create a bundle
    Peregrinus, expectavi pedes meos in cymbalis
    Nullus norvegicorum sole urinat

  4. #4
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25
    By 'Bundle' I believe that he simply means the way an "App" is packaged...

    All those neat little App-like files that you just drag and drop into your Applications folder are really just fancy folders that contain files, yet act like an executable file. If you hold down the Option button while you right click on an "App" you'll see the option "Show Package Contents" to see the contents. If you select this you can go in and modify the contents. If your case add textures, audio files, etc...
    Jason McMillen
    Pascal Game Development
    Co-Founder





  5. #5
    I found the problem, guys.
    The problem is the unit cmem!
    I included it because I read that when using fpc threads we should include cthreads and cmem units as the first units in the program.
    But this breaks the program everywhere, things like SetLength fail, for example.
    FPC bug, or cmem is not needed anymore, or something else?

  6. #6
    Hm, I never used cmem, and my apps worked fine on Linux and MacOS X But if you need it, maybe you forgot that cmem unit should be the first unit in the uses clause?

  7. #7
    Yes, but do you use TThread?
    I don't really need cmem unit, so if you can use threads without it, better.
    Also, I can't really get a single window application running, APPTYPE seems to don't work in MacOS?
    My application now opens both a Carbon window and a console window, and while the console is useful for printing info, I want to be able to choose between having it or not.
    Any special switch I need to compile?
    (I don't use SDL or anything else, I create my window directly using Carbon, the code was based on a C++ sample I found on the web.)

  8. #8
    Quote Originally Posted by Relfos
    Yes, but do you use TThread?
    For sound streaming I use BeginThread. And I add unit cthreads to my uses clause.

    Quote Originally Posted by Relfos
    APPTYPE seems to don't work in MacOS?
    If you were read FPC documentation, you would know this...

    Quote Originally Posted by Relfos
    Also, I can't really get a single window application running, APPTYPE seems to don't work in MacOS?
    GUI applications under MacOS X are not an one single executable. You must "build" your own Bundle. Simple description "what is Bundle" can sounds like this: "Bundle is a directory with name which contains part "name" and ".app"(for example - MyApp.app). Inside this directory must be another one - Contents. Inside Contest must be directories Frameworks(for your libs/etc.), MacOS(for your executable, which must be with the same name as your bundle, in our case - MyApp) and Resources(where you must put all your resources)".
    Last edited by Andru; 03-02-2011 at 05:48 PM.

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
  •