Thread: C using Code::Blocks IDE compiling cross platform / machine issue

  1. #1
    Registered User
    Join Date
    Oct 2015
    Posts
    15

    C using Code::Blocks IDE compiling cross platform / machine issue

    This is more of an IDE question than a language issue; however, I writing in C and using Code::Blocks 13.12 on three different machines. Two Windows 7 desktops and one Windows 7 laptop which dual boots into Ubuntu 14.1 (I think.)

    I move around frequently from office, to home, to coffee shop so naturally I upload my code to my dropbox before heading to a different location.

    I know Code::Blocks compiles and runs on each machine just fine and I've been working between machines for quite some time without issue. That being said I have encountered a recent problem with code that runs on one machine crashing during execution on another.

    Here is my process:

    Work Computer:
    1. Setup a project
    2. Link any needed libraries
    3. Write code
    4. Compile and Run (Happy face)
    6. Upload to dropbox

    Laptop:
    1. Download code
    2. Re-link libraries
    3. Rebuild code.
    4. Run code (Happy Face)
    5. Upload to dropbox

    Home Computer:
    1. Download code
    2. Re-link libraries
    3. Rebuild code.
    4. Run code (Frownie Face)

    Since the code itself doesn't change between the time it is uploaded to the time it is downloaded, I am confused as to why it fails to run. More specifically, it crashes. Since Windows isn't throwing me any error codes it's hard for me to diagnose the issue. I am hoping someone else has encountered a similar problem and found a resolution.

  2. #2
    Registered User
    Join Date
    Jun 2015
    Posts
    1,640
    Have you considered that it is possible for a bug to not show up due to (bad) luck? It's possible for code to "run" on one machine and yet crash on another due to a different memory layout or whatever. Look for a bug in the code.
    Last edited by algorism; 01-09-2016 at 04:06 PM.

  3. #3
    Registered User
    Join Date
    Oct 2015
    Posts
    15
    Yes, sadly. I'm looking for oddities. If it's not the code itself, it could be some system configuration that I've left unchecked or haven't noticed.

  4. #4
    Registered User
    Join Date
    Oct 2015
    Posts
    15
    Found it!!!

    It's a Windows issue:
    Windows 7's color scheme is set to 32bit. The program I wrote was running 16bit color. Apparently, some Windows machines have trouble with this. I changed the program's color depth to 32 and everything is fine now.

    Thanks!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 03-30-2013, 02:50 AM
  2. Code::Blocks not compiling?
    By UCFuser in forum C Programming
    Replies: 13
    Last Post: 09-28-2012, 08:23 AM
  3. Compiling GTK+ C Programs in Code Blocks
    By Flotonic in forum C Programming
    Replies: 5
    Last Post: 03-24-2011, 06:10 PM
  4. Feedback: compiling games cross platform
    By Clayton in forum C++ Programming
    Replies: 3
    Last Post: 08-27-2010, 11:14 AM
  5. Cross-platform code...
    By Sul in forum C++ Programming
    Replies: 10
    Last Post: 06-18-2004, 04:44 PM