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

  • Home
  • SEARCH
  • 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 6231685
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T09:58:42+00:00 2026-05-24T09:58:42+00:00

I am trying to run these two .data files from my c++ code for

  • 0

I am trying to run these two .data files from my c++ code for my assignment. I have been provided with all the files and are meant to only implement a few functions for the program (everything should be able to compile running the make command).

I used to run a MAC and only just started using windows (win 7) because work gave me a free laptop. Anyways…I installed cygwin, added the gcc-c++ compiler, gdb and make packages to my cygwin. But when i run the command ./file ./data it comes up with:

bash: ./file: cannot execute binary file

is there a certain package or something I am suppose to install? Please note, that ./data is the folder that holds my two .data files, file1.data and file2.data

compiled by”

g++ -Wall -Werror -02 -c file.cpp
g++ -Wall -Werror -02 -c file-test.cpp
g++ -Wall -Werror -02 -o file file.o file-test.o
  • 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-24T09:58:43+00:00Added an answer on May 24, 2026 at 9:58 am

    Start by using the file command to see what type of binary file you have:

    file ./file
    

    If it is not an executable, that is a problem. If it is an ELF executable then it is probably intended to run on Linux, not on Windows. For example compare the output with this command:

    file /bin/bash
    

    which should tell you:

    /bin/bash: PE32 executable (console) Intel 80386 (stripped to external PDB), for MS Windows

    Now try this command:

    file /cygdrive/c/windows/write.exe
    

    Which says the following:
    /cygdrive/c/windows/write.exe: PE32+ executable (GUI) x86-64, for MS Windows

    I ran this on a 64-bit Windows 7 installation, which is why it says x86-64. Even though this is a Windows GUI app totally unrelated to cygwin, I can still run it by the command:

    /cygdrive/c/windows/write
    

    You really did not explain how you got this binary file named ./file. Is it possible that it is an object file from compiling that you have not yet linked into an executable? If you have a Makefile, why not post its contents?

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

Sidebar

Related Questions

I'm trying to run a batch file, as another user, from my web app.
I am trying to run xcopy that copies files excluding .obj, etc. What I
I am trying to run the VS 2008 SP1 installer , but it says
I'm trying to run some queries to get rid of XSS in our database
I'm trying to run a LINQ to SQL query that returns a result in
I'm trying to run a process and do stuff with its input, output and
I'm trying to run the Tomcat with JBoss Embedded jpa booking example. I run
I'm trying to run SQuirreL SQL. I've downloaded it and installed it, but when
I'm trying to run an ASP.NET 2.0 application on an XP machine. As far
I'm trying to run some commands in paralel, in background, using bash. Here's what

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.