Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: valeryf2 on June 30, 2019, 07:10:41 pm

Title: C| Code debug problem
Post by: valeryf2 on June 30, 2019, 07:10:41 pm
Hi,
I wrote a code on windows machine, and then stored the workspace on Google Drive.
now i am trying to build the same workspace on a Mac (Mojave ver.) machine.
and when i press the "run and build" button this is the warning that i get:
Code
||=== Build: Debug in Avrge_Sales_on_a_day (compiler: GNU GCC Compiler) ===|
||warning: ignoring file obj/Debug/main.o, file was built for unsupported file format ( 0x4C 0x01 0x0B 0x00 0x00 0x00 0x00 0x00 0xE0 0x06 0x00 0x00 0x1A 0x00 0x00 0x00 ) which is not the architecture being linked (x86_64): obj/Debug/main.o|
||=== Build failed: 0 error(s), 1 warning(s) (0 minute(s), 0 second(s)) ===|
Title: Re: C| Code debug problem
Post by: oBFusCATed on June 30, 2019, 07:36:09 pm
Press rebuild and it will work. Or use different object file folders for different OSes (you'll have to use different targets).
Title: Re: C| Code debug problem
Post by: valeryf2 on June 30, 2019, 08:49:17 pm
But i want to use both machines... what is the point if i cant use my updates from my main or second machine??

i tried to rebuild and that was the error that showed up on terminal:
Code
Last login: Sun Jun 30 21:45:08 on ttys000
/Applications/CodeBlocks.app/Contents/MacOS/cb_console_runner DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:. /Users/valery-mac/Google Drive/Thenewboston_program learning/C_learn/Programs/Avrge_sales_on_a_day/Avrge_Sales_on_a_day/bin/Debug/Avrge_Sales_on_a_day
valeryfdmansMBP:~ valery-mac$ /Applications/CodeBlocks.app/Contents/MacOS/cb_console_runner DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:. /Users/valery-mac/Google Drive/Thenewboston_program learning/C_learn/Programs/Avrge_sales_on_a_day/Avrge_Sales_on_a_day/bin/Debug/Avrge_Sales_on_a_day
sh: /Users/valery-mac/Google: No such file or directory

Process returned 127 (0x7F)   execution time : 0.003 s
Press ENTER to continue.

Title: Re: C| Code debug problem
Post by: oBFusCATed on June 30, 2019, 08:56:08 pm
what is the point if i cant use my updates from my main or second machine??
If you share incompatible files there is no way it is going to work. So you have to either not share these files or store them in an os dependent location. It is up to you. Obviously .o files produced on windows doesn't work on linux or macos.



i tried to rebuild and that was the error that showed up on terminal:
Code
Last login: Sun Jun 30 21:45:08 on ttys000
/Applications/CodeBlocks.app/Contents/MacOS/cb_console_runner DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:. /Users/valery-mac/Google Drive/Thenewboston_program learning/C_learn/Programs/Avrge_sales_on_a_day/Avrge_Sales_on_a_day/bin/Debug/Avrge_Sales_on_a_day
valeryfdmansMBP:~ valery-mac$ /Applications/CodeBlocks.app/Contents/MacOS/cb_console_runner DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:. /Users/valery-mac/Google Drive/Thenewboston_program learning/C_learn/Programs/Avrge_sales_on_a_day/Avrge_Sales_on_a_day/bin/Debug/Avrge_Sales_on_a_day
sh: /Users/valery-mac/Google: No such file or directory

Process returned 127 (0x7F)   execution time : 0.003 s
Press ENTER to continue.

Known problem. Search the forum.
Title: Re: C| Code debug problem
Post by: sodev on June 30, 2019, 09:02:30 pm
You are writing native code, it is dependend on the target, and since windows and macos are far away from beeing compatible this can never work.

But this doesnt matter, the source code does matter, and this of course can be shared. Just dont share the binaries, especially not the intermediate object files.
Title: Re: C| Code debug problem
Post by: valeryf2 on June 30, 2019, 09:44:46 pm
ok thanks
Title: Re: C| Code debug problem
Post by: valeryf2 on June 30, 2019, 09:45:22 pm
what is the point if i cant use my updates from my main or second machine??
If you share incompatible files there is no way it is going to work. So you have to either not share these files or store them in an os dependent location. It is up to you. Obviously .o files produced on windows doesn't work on linux or macos.



i tried to rebuild and that was the error that showed up on terminal:
Code
Last login: Sun Jun 30 21:45:08 on ttys000
/Applications/CodeBlocks.app/Contents/MacOS/cb_console_runner DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:. /Users/valery-mac/Google Drive/Thenewboston_program learning/C_learn/Programs/Avrge_sales_on_a_day/Avrge_Sales_on_a_day/bin/Debug/Avrge_Sales_on_a_day
valeryfdmansMBP:~ valery-mac$ /Applications/CodeBlocks.app/Contents/MacOS/cb_console_runner DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:. /Users/valery-mac/Google Drive/Thenewboston_program learning/C_learn/Programs/Avrge_sales_on_a_day/Avrge_Sales_on_a_day/bin/Debug/Avrge_Sales_on_a_day
sh: /Users/valery-mac/Google: No such file or directory

Process returned 127 (0x7F)   execution time : 0.003 s
Press ENTER to continue.

Known problem. Search the forum.
ok thanks =)