Results 1 to 10 of 31

Thread: Problem with FreePascal + MacOS

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25
    This has probably been found by any of those looking into Objective-Pascal or Cocoa for Pascal, but here it is just the same: http://wiki.freepascal.org/FPC_PasCocoa

    It outlines the initial idea behind Objective-Pascal and how it was implemented by the Free Pascal compiler team. It also tells you how to enable it for your projects too.
    Jason McMillen
    Pascal Game Development
    Co-Founder





  2. #2
    Thanks! I've been reading about Cocoa, and Objective Pascal, and how it all works, I still need some days to understand it correctly.
    My next question, tough, this should be probably in a new topic:
    Today I managed to compile a Free Pascal program for iPhone using XCode and the included template.
    However when reading the code, I found that it was not 100% pascal, at least half of the code were Objective C, and the pascal code was declared as external in a library.
    I understand how this works, but is it the only way?
    Or can one create an app for iPhone that uses only pascal, and is compiled just using the command line?

  3. #3
    Quote Originally Posted by Relfos View Post
    I understand how this works, but is it the only way?
    There are two other ways:
    1. Use SDL which takes care of most things. Remember, you can use SDL free of charge if you're application is released as GPL, only if you to release your application as freeware or commercial you need to buy a license before the application is released.

    2. Use Objective-Pascal as explained here: http://www.thealchemistguild.org/pascal/ <-- Take a look at the iArkanoid example.
    Freeze Development | Elysion Game Framework | Twitter: @Stoney_FD
    Check out my new book: Irrlicht 1.7.1 Realtime 3D Engine Beginner's Guide (It's C++ flavored though)

    Programmer: A device for converting coffein into software.

  4. #4
    Thank you Stoney, I did not know that website, it contains really useful information
    I'm planning to release comercial applications, but SDL price is okay, I will look how much work is needed to replace it tough.

  5. #5
    Quote Originally Posted by Relfos View Post
    Thanks! I've been reading about Cocoa, and Objective Pascal, and how it all works, I still need some days to understand it correctly.
    My next question, tough, this should be probably in a new topic:
    Today I managed to compile a Free Pascal program for iPhone using XCode and the included template.
    However when reading the code, I found that it was not 100% pascal, at least half of the code were Objective C, and the pascal code was declared as external in a library.
    I understand how this works, but is it the only way?
    Or can one create an app for iPhone that uses only pascal, and is compiled just using the command line?
    You mean the Objective-C library called FPC code? I have messed a lot with mixing C and FPC code, and recently learned the right way to do that, and that is indeed to put all the FPC code in a separate dylib library (shared library). It is theoretically possible to do static linking, but don't even try, it is not worth it.

    However, the Objective Pascal dialect works very well (Stoney's suggestion #2). That's what you should use. It is still changing, which can be a bit frustrating at times, but it works.

  6. #6
    Quote Originally Posted by Ingemar
    to put all the FPC code in a separate dylib library
    Not a solution for iOS, where dylib's are not allowed.

  7. #7
    I don't know if I already said so, but I got this working, for both Mac and iOS (here I use the solution of mixing pascal with Objective-C, since I had some problems with the objective pascal compiler). I will probably try to move into Objective Pascal later tough.

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
  •