Hi,
I'm trying to set up Code::Blocks on my Mac for school use. I've been trying to run Hello World with no success. I have read that Macs have an issue dealing with spaces in file names so I have already avoided that. I also downloaded Xcode and the command line tools that are apparently required for Code::Blocks to work properly. Lastly, this is the current code I'm using for my "Terminal to launch programs":
osascript -e 'tell app "Terminal"' -e 'activate' -e 'do script "exe=\'$SCRIPT\'; cd \\"${exe%/*/*/*}\\"; clear; \\"${exe% }\\"; echo - e \'Press any key to continue...\'; read -n 1; osascript -e \'tell app \\"CodeBlocks\\" to activate\'; exit"' -e 'end tell'
This is what is being displayed in the terminal when I hit Build & Run for "Hello World":
Last login: Wed Feb 19 12:51:17 on ttys001
exe='/Applications/CodeBlocks.app/Contents/MacOS/cb_console_runner DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:. /Users/grantshipp/Documents/School/compsci/helloworld/bin/Debug/helloworld '; cd "${exe%/*/*/*}"; clear; "${exe% }"; echo - e 'Press any key to continue...'; read -n 1; osascript -e 'tell app "CodeBlocks" to activate'; exit
grants-mbp:~ grantshipp$ exe='/Applications/CodeBlocks.app/Contents/MacOS/cb_console_runner DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:. /Users/grantshipp/Documents/School/compsci/helloworld/bin/Debug/helloworld '; cd "${exe%/*/*/*}"; clear; "${exe% }"; echo - e 'Press any key to continue...'; read -n 1; osascript -e 'tell app "CodeBlocks" to activate'; exit
-bash: cd: /Applications/CodeBlocks.app/Contents/MacOS/cb_console_runner DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:. /Users/grantshipp/Documents/School/compsci/helloworld: No such file or directory
-bash: /Applications/CodeBlocks.app/Contents/MacOS/cb_console_runner DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:. /Users/grantshipp/Documents/School/compsci/helloworld/bin/Debug/helloworld: No such file or directory
- e Press any key to continue...
If anyone could help me out it'd be greatly appreciated. :)
I've managed to get past the issue posted in my OP (or just masked it with another issue, let's hope that's not the case) but now I'm facing another one.
When I try to run the standard hello world script, this is what is being returned in the build log.
-------------- Build: Debug in helloworld (compiler: GNU GCC Compiler)---------------
g++ -L/usr/lib -o bin/Debug/helloworld obj/Debug/main.o
Undefined symbols for architecture x86_64:
"std::ostream::operator<<(std::ostream& (*)(std::ostream&))", referenced from:
_main in main.o
"std::ios_base::Init::Init()", referenced from:
___cxx_global_var_init in main.o
"std::ios_base::Init::~Init()", referenced from:
___cxx_global_var_init in main.o
"std::cout", referenced from:
_main in main.o
"std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)", referenced from:
_main in main.o
"std::basic_ostream<char, std::char_traits<char> >& std::operator<<<std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)", referenced from:
_main in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Process terminated with status 1 (0 minute(s), 0 second(s))
0 error(s), 0 warning(s) (0 minute(s), 0 second(s))
Any clue what the issue might be and how I can fix it?