Yesterday, I get home after work and get on the computer. Go to open up code:blocks and I was getting an error message relating to a config file in AppData. So I look up the issue, and people say just delete it and restart C:B. So I do that, and now C:B opens up fine.
I open up the project I'm working on, make some changes, hit build and run. I notice it "builds" almost instantly, and runs but it runs the old code before the change. I close the window, look at the code, and it looks fine. So I think, "Ok, I'll save the project, close C:B, reopen and build again". I do all that, and sure enough it still doesn't work. I look at the build log and see that the toolchain path is messed up supposedly. So I go in and verify that everything is in the right place and C:B is finding everything. Says it is, so I try again, and sure enough still not building. I was getting annoyed at this point, so I try resetting the toolchain path to default (I knew it used to work just two days ago), and it gives me a nice little "Congrats this worked just fine" message. So I was excited, go to the project, hit build, and nothing. No building.
After all this, I decide that ok, I'll just uninstall C:B, and download a new one. That takes a little bit, I come back after it's all installed, open my project again, and now it builds. Supposedly. So I run the program, and now my anti-virus pops up a message and tells my program is now a trojan horse! I close this box cause I know it's not, and go to my window, and nothing is being displayed. It just said it ran and how long it took (which was almost nothing since it did nothing).
My next test was to make a new project and see what happened. Sure enough, same story. Builds, runs, AV gets mad, no output. After this, I was running out of ideas. I ran my AV, sure enough my one virus was still my program, so I deleted it. (I have a backup, of course). Loaded in my backup copy, built, ran, and same damn thing! No output, and AVG still says its a virus. And no, not a single system call in there.
tl;dr, C:B f****ed up and now won't run anything, EVER! Not sure what to do
I guess that, either you are somehow working on a copy of the files, or the project just lost track of everything.
At worst you would just need to regenerate the project (the structure).
Try to clean the build and see the makefile.
Also, kill the antivirus.
And issue bugs reports.
That takes a little bit
As in a significant time that is annoying.
Or so fast that you wouldn't notice.
Edit: Oh, you've got to download again, never mind.
It sounds like you didn't update the project's compiler when you set up your compilers again.
Be aware that C::B checks the compilers when it starts - so if a compiler is unavailable then (for example, because you haven't mounted the partition yet), you have to restart C::B after fixing it.
The rest is AVG's fault - purge it.
Regarding the AV issue, Avast did something similar concerning new applications with no reputation. See if there is an exclude setting you can add the project directory to. Does AVG give you a specific virus name?
Ok ok, what the f*** is this sh**? I was messing with everything, decided to have main return 1 for shits and giggles, and sure enough it runs just fine. No problems. I go back to return 0, and doesn't output and AV gets pissy again.
Pardon my language. Frustration got the best of me. Just sooo tired of this. Putting me quite behind on my project.
I have added it to the the path variable. Multiple times even. I tried just sticking the MingW directory in there and that didnt work, so I tried sticking the MingW\bin directory in there and same thing. I originally thought it was my compiler, but this whole returning 1 and it works but returning 0 and it doesn't makes me think otherwise. I've never heard of the problem and can't seem to find it anywhere.
So I run the program, and now my anti-virus pops up a message and tells my program is now a trojan horse! I close this box cause I know it's not, and go to my window, and nothing is being displayed.
Obviously, because it's not like anybody can infiltrate an open-source project and add malicious code. And an antivirus is not trustworthy anyway, especially if it says the same thing for different programs.
Try installing the custom build of MinGW I linked to a couple of posts ago.
If that works, you can continue your project work by compiling from the command line (it has ready-made batch files for setting up paths).