Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6642609
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:57:04+00:00 2026-05-25T23:57:04+00:00

I am developing a C app using Code::Blocks, and need to target multiple platforms

  • 0

I am developing a C app using Code::Blocks, and need to target multiple platforms (32 bit, 64 bit). My development box is 64 bit, so I tried to check the i386 (-march=i386) option for the compiler in the project settings. Now when I compile I get:

mainc:1: error: CPU you selected does not support x86-64 instruction set

  1. I don’t understand this message! By specifying i386 shouldn’t it be just generating x86 instructions (not -64)? Beside, my CPU is X86-64 so why say my cpu doesn’t support this?

  2. Am I doing this the wrong way? Is there a RIGHT way to target different architectures?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T23:57:05+00:00Added an answer on May 25, 2026 at 11:57 pm

    You must distinguish several things here:

    • There are 32 and 64 bit “platforms” that run on the same processor. The same X86-64 processor can operate in either x86 or AMD64 mode. This determines among other things the number of available registers, their sizes, stack layout, different calling convention, and some different opcodes (also note that on many operating systems, 32 bit code will run in some kind of compatibility layer in a 64bit OS without problems)
    • There are compilers for either one of these platforms, and there are compilers which can produce either of both (but not both at the same time).
    • The compiler can be a different platform from what the program is built for (so-called cross-compiler, very common thing e.g. when developing for embedded systems, but you can also cross-compile for example for Windows-32 from Linux-64 or the other way around, or compile for Win64 on a Win32 computer).
    • In addition to the platform, there is a model-specific difference in generated code (-march switch). This decides what processor generation is assumed, which determines what instructions can be used in generating code. Not every combination of platform and architecture is valid (this is your very problem: assuming a 25 year old 386 processor means that it cannot possibly run in AMD64 mode).
    • Optionally, you can even schedule for something different than you generate code for. You can for example generate code that uses instructions for up to Pentium III, but schedule for Core i7. This will run (sub-optimally, but it will run) on pretty much every processor, and run optimally on the newest line.
    • Finally, there are many switches such as the -msse family which further enable/disable instructions.

    You did not specify “Windows” or “Linux” or anything else, so it is hard to give an exact answer to what your problem is, but let’s assume you might be using for example MingW-w64. This compiler lets you create both 32 and 64 bit code, depending on what you tell it to do. Obviously, if you tell it to generate code in 64 mode (the default!), then i386 is not a good choice. If you give it -m32 as a commandline option, it will generate 32bit code, and it will work.

    It may help finding a more concrete answer if you tell exactly what compiler you use. Code::Blocks comes (optionally) with the TDM 4.5.1 build on Windows, for example, but uses whatever is there under other operating systems.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing an ASP.NET 2.0 app using Visual Studio 2008. If I want to
I am developing a forms app (not web) for Windows Mobile, using .NET CF
I'm using the RESTful authentication Rails plugin for an app I'm developing. I'm having
I'm using the data mapper pattern in a PHP app I'm developing and have
I'm using Windows Vista x64 with SP1, and I'm developing an ASP.NET app with
I'm developing a website. I'm using a single-page web-app style, so all of the
Im developing a touchscreen app and I need to hide the cursor whenever it
I am developing a small app under Linux using the CodeBlocks IDE. I have
I am developing a web app using ASP.NET 2.0 (C#), where on home page
I am developing an app using WinForms and the RichTextBox control. This control allows

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.