0

I'm attempting to compile a C project (https://github.com/AbderrSfa/cub3d), but the Makefile I believe was written for OSX (it uses the -framework command) and I'm unsure on how I can convert it to be usable on Linux. I found this post but it didn't solve my issue. This program uses AppKit (from what I've seen that's specifically for Macs) and as a result I do not know how to use the principle described in that answer for this file. So, is there a way I can properly use this with Linux? Thank you so much!

Exact Error:

gcc: error: unrecognized command-line option ‘-framework’

Where '-framework' is used

MLX = -L /usr/local/lib/ -lmlx -framework OpenGL -framework AppKit
nezzled
  • 93
  • 10
  • It sounds like the program is written specifically for MacOS. You can't just recompile it for another platform, you would need to recode the Mac-specific parts. – Barmar Jun 08 '23 at 20:15
  • As you've seen from the question you linked some of the things the frameworks provide can be satisfied by linking the correct libraries. You said you tried that and it didn't work but you haven't told us what specifically happened. What were the errors you received? I would assume you have some link errors. What you'd need to do from there is examine the code that uses that functionality and either add a library that provides that functionality or replace the code with something equivalent that works on linux. – Retired Ninja Jun 08 '23 at 20:15
  • Maybe [this](https://stackoverflow.com/questions/13606932/porting-objective-c-terminal-apps-from-mac-os-x-to-linux) is helpful. – Barmar Jun 08 '23 at 20:16
  • "cub3d" seems to be a "42 School" project. This [questionable source](https://harm-smits.github.io/42docs/projects/cub3d) points towards some [documentation](https://harm-smits.github.io/42docs/libs/minilibx) for [`minilibx`](https://github.com/42Paris/minilibx-linux), which includes resources on [Getting Started / Compilation on Linux](https://harm-smits.github.io/42docs/libs/minilibx/getting_started.html#compilation-on-linux). This might help, but YMMV (every bit of `ft_` code I have come across has been of rather dubious quality). – Oka Jun 08 '23 at 21:06
  • @RetiredNinja while it fixed the -framework error, the exclusivity of the libs to MacOS meant that everything else was missing dependencies, so it just ended up a soy sauce birthday cake of errors from various scripts. – nezzled Jun 08 '23 at 22:49
  • @Barmar I see this has to do with a "port" of Cocoa, but this project doesn't actually make use of it. Unless I'm missing the point of it, I don't think this will change much.. Thank you, though! – nezzled Jun 08 '23 at 22:51
  • @Oka That's actually the page I used to compile it! It's not an issue with MiniLib or its documentation, it's the Makefile for the project itself. – nezzled Jun 08 '23 at 22:52
  • That documentation explains the dependencies and what changes need to be made to the makefile. Seems easy enough to me. – Retired Ninja Jun 09 '23 at 00:05

0 Answers0