I have a c++ program, which should get the file name from argv
, open this file, and work with it.
Program works perfectly well, because: when I call binary (Unix Executable
) from the terminal, program gets th name from argv
and works with it, but when I made from this binary MacOs program .app
, then, by double clicking on file, which program should open, program throws this error:
And again, if I launch binary (which already in .app
directory), everything works, but if i run programm .app
from terminal, program will throw this error again
list of terminal commands, that I tested:
open -a /Applications/Sengine.app obj/rogers.mdl
- didn't work
/Applications/Sengine.app/Contents/MacOS/SENGINE obj/rogers.mdl
- did work
cmake-build-debug/SENGINE obj/rogers.mdl
- did work
I'm compiling program with cmake
:
/Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake --build cmake-build-debug --target SENGINE -- -j 3
File info.plist
from .app
program, just in case:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDisplayName</key>
<string>Sengine</string>
<key>CFBundleExecutable</key>
<string>Sengine</string>
<key>CFBundleIconFile</key>
<string>icon.icns</string>
<key>CFBundleIdentifier</key>
<string>com.zolars.sengine-department.SENGINE</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Sengine</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>3.0.0</string>
<key>NSHighResolutionCapable</key>
<true/>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeIconFiles</key>
<string>mdl.icns</string>
<key>LSItemContentTypes</key>
<array>
<string>mdl</string>
</array>
<key>LSHandlerRank</key>
<string>Owner</string>
</dict>
</array>
</dict>
</plist>
If I understood rightly, for some reason name of the file, after double clicking, doesn't reach source binary. I can't figure out why, and how to fix it.
Help me please with this.