0

I have written a program in Bloodshed using the C language for homework, but after clicking compile and run, I get an error message saying: Source file not compiled. I have ran compile only with it telling me that it's done, but when I compile and run afterwards, I get the same previous error message. How do I fix this? I am using windows 10 and here is the program:

/*TECH 1211 Computer Programming             */ 
/*Mark Bowman                                */ 
/*Program Name  "Formatted Output of Table"  */ 
/*Spring 2019                                */ 
#include<stdio.h> 
#include<stdlib.h> 

int main (void) {
    printf("Mark Bowman\n\n");
    char airline;
    printf("Enter the first letter of the airline:");
    scanf("%c",&airline);   

    int airline_number;     
    printf("Enter the flight number:");
    scanf("%d",&airline_number);

    int hour,minute;
    char time_of_day;
    printf("Enter the departure time as  (hh:mm)");
    scanf("%d:%d %c",&hour,&minute,&time_of_day);

    float ticket_price;
    printf("Enter the ticket price:");
    scanf("%f",&ticket_price);
    printf("\n\n\nAirline Flight\tDeparture\tTicket\n\t\tNumber\tTime\tPrice\n\t  %c %d\t%d:%d %cm\t$%.2f\n\n\n--------------------------",airline,airline_number,hour,minute,time_of_day,ticket_price);     
    return(0);   
}
Ken White
  • 123,280
  • 14
  • 225
  • 444
M.Bowman
  • 11
  • 1
  • 1
  • 3
    You should try to format and indent your code by 4 spaces, so it becomes readable. Last I heard Bloodshed Dev C++ is severely out of date, so you might want to look into something else, unless it is a course requirement. – visibleman Feb 04 '19 at 00:26
  • 2
    Please format your code so it's easier to read. https://stackoverflow.com/editing-help – Dan Feb 04 '19 at 00:33
  • 1
    The code you have posted compiles fine in clang & gcc various versions. Bloodshed is probably using an old version of mingw, and I haven't tested that. You should include the complete error message that you get as well. – visibleman Feb 04 '19 at 01:27
  • You get no other error message than the exact words *Source file not compiled*? No other error text? No other problem information other than *Source file not compiled*? – Ken White Feb 04 '19 at 01:27
  • Ken White, no other error message other than the one posted, – M.Bowman Feb 04 '19 at 01:55
  • visibleman, unfortunately it is a requirement from the professor. – M.Bowman Feb 04 '19 at 01:55
  • I also tried this program in CodeBlocks, exactly as posted here, and got this error: Aborted (program collect2) Does anyone have any ideas on a fix? – M.Bowman Feb 04 '19 at 02:15
  • Searching SO for 'Aborted (program collect2)' turns up this as one of the first results. https://stackoverflow.com/questions/12811762/dev-c-in-windows-8-gcc-internal-error – visibleman Feb 04 '19 at 02:42
  • 1
    Old compiler? Try moving all your variable declarations to the top of main. I don't see anything else that would be a problem even with really old compilers. Maybe also try putting a space after your #include. – Bob Shaffer Feb 04 '19 at 06:39
  • 1
    @Bob Shaffer, while that is a good suggestion. I think the problem is more related to the fact that some old mingw versions doesn't work on Windows Vista and newer. The mention of Collect2 seems to indicate the problem is in the linking phase. – visibleman Feb 04 '19 at 07:28
  • @visibleman I missed that comment, and I agree. It seems strange, though. The codeblocks thing clearly says it works on Vista/7/8/10. I couldn't even find the bloodshed downloads. – Bob Shaffer Feb 04 '19 at 07:57
  • Since Bloodshed is no longer available, we cannot duplicate your results. So please post your compile statement, your link statement, and the configuration file for Bloodshed. – user3629249 Feb 05 '19 at 02:47
  • the error message is a bit misleading. Overall, it seems the IDE is installed, the header files are installed, but not the libraries. – user3629249 Feb 05 '19 at 02:49

1 Answers1

1

I just came across this issue and it turns out Bloodshed Dev C++ is not compatible with Windows 10. It didn't even detect any errors during compilation if I intentionally added them.

Fortunatelly, there's this open source project called Embarcadero Dev-Cpp which is a port to Windows 10, they even have a portable version that works very well.