Author Topic: C| Code debug problem  (Read 3467 times)

Offline valeryf2

  • Multiple posting newcomer
  • *
  • Posts: 10
C| Code debug problem
« 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)) ===|
« Last Edit: June 30, 2019, 07:12:14 pm by valeryf2 »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: C| Code debug problem
« Reply #1 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).
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline valeryf2

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: C| Code debug problem
« Reply #2 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.


Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: C| Code debug problem
« Reply #3 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.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Online sodev

  • Regular
  • ***
  • Posts: 498
Re: C| Code debug problem
« Reply #4 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.

Offline valeryf2

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: C| Code debug problem
« Reply #5 on: June 30, 2019, 09:44:46 pm »
ok thanks

Offline valeryf2

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: C| Code debug problem
« Reply #6 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 =)