Running a program from Xcode fails

Hi, ALL, I have a weird problem.

I'm successfully building my software (C++) on my Mac with Xcode.

I did create a post-build script to copy all needed libraries over to the Bundle and call "install_name_tool -change" for all of them.

I can successfully run "open my_app.app" from the directory it is located.

However, trying to run it from inside Xcode, does not work. It stops somewhere in the OSX CRT even before trying to open the main frame.

What would be the best way to achieve running the program from both Xcode and the Terminal?

Thank you.