-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using ofxNetwork on an iOS project hijacks OF's main() #5980
Comments
wtf. perhaps we can try to remove that file before compiling freeimage for ios |
btw, I think freeimage uses some flag to hide internal symbols from binaries linking to it but no idea why that one specific line would unhide it. |
Also worth nothing, the same thing happens in both the Simulator and a real iOS device, so It affects both architectures the same way... |
This should be solved now but would be good if you can check. |
Yep I just tested on RC2 and the |
Making a new ios project with PG, if ofxNetwork is added, your project will not launch when run. Instead, the app spits out this huge table and quits.
Googling lead me to this... Apparently there's an
int main()
function within the freeimage library??? WTF??Anyway, somehow, including ofxNetwork makes the project launch that
main()
within FreeImage instead of themain()
defined in your project'smain.mm
file. I've painstakingly isolated the issue within ofxNetwork; it turns out theofxUDPManager.cpp
file is to blame. If you removeofxUDPManager.cpp
from the project and run it, the expected main() is launched, and the app works as normal. If you add it back, the freeImagemain()
runs instead.At this point I was too curious to stop, so I've been slowly commenting out code within ofxUDPManager.cpp and re-running the project to see what part of the code could possible be responsible for this bizzare feat...
I've isolated it to the method
ofxUDPManager::BindMCast(char *pMcast, unsigned short usPort)
, and even more precisely, this line:Leaving this line as it is, makes the project not launch. Commenting it out, makes the project work as normal.
This is one of the weirdest things I've ever seen, I would love to hear a rational explanation of what's triggering this! I wonder if it's a linker bug of some sort?
I can be reproduce this using the latest Master and also a much older revision (~mid-2017). I'm using macOS 10.13.3 to test, and the latest XCode (9.3).
The text was updated successfully, but these errors were encountered: