Author Topic: Help with compiling errors  (Read 11836 times)

Offline GingerDolphin

  • Multiple posting newcomer
  • *
  • Posts: 11
  • Qwerty should be a word.
Help with compiling errors
« on: July 13, 2014, 03:48:06 am »
I'm not sure what it is i'm doing wrong, but I think I changed some settings somewhere, because of this error in the build log:

"Execution of 'mingw32-g++.exe   -c D:\learnersCode\testing.cpp -o D:\learnersCode\testing.o' in 'C:\Users\Owner\Desktop' failed"

I'm wondering if this has something to do with having two different search things in both drives? I don't know how to even begin fixing this  :'( .

I was just running a simple hello world program, but i called it testing so i could add more to it and not be confused with the name. I doubt you need the source code, but if you do just tell me.
It took me an hour to register here. I was a robot for an hour, don't mess with a former robot O.O

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Help with compiling errors
« Reply #1 on: July 13, 2014, 11:21:22 am »
Look at the full log. Do you have mingw32-g++.exe installed?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Help with compiling errors
« Reply #2 on: July 13, 2014, 02:57:07 pm »
And do you have enough access rights to write (and probably overwrite) files in the folders you use ?
« Last Edit: July 13, 2014, 03:08:19 pm by jens »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline GingerDolphin

  • Multiple posting newcomer
  • *
  • Posts: 11
  • Qwerty should be a word.
Re: Help with compiling errors
« Reply #4 on: July 13, 2014, 10:10:44 pm »
@oBFusCATed 
Yes, it should be installed, as I can actually go to the file physically, Code::Blocks just seems to be having trouble finding it.

@jens
I should have full access to everything, after all I'm an administrator on this computer, unless you meant something else by that. If you did, then I don't know.

@stahta01
I don't have anti-virus, at all.

Is there any other information I can give to narrow down the problem? I'll check out all the links, though.
« Last Edit: July 13, 2014, 10:14:18 pm by GingerDolphin »
It took me an hour to register here. I was a robot for an hour, don't mess with a former robot O.O

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Help with compiling errors
« Reply #5 on: July 13, 2014, 10:43:14 pm »
Posting a build log might help; till you post one we will not know.

I suggest posting the normal info.
Like CB Version, OS Name, Compiler name and version.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Help with compiling errors
« Reply #6 on: July 13, 2014, 10:56:40 pm »
@jens
I should have full access to everything, after all I'm an administrator on this computer, unless you meant something else by that. If you did, then I don't know.

If you are on Windows >= 7 being member of the adminstrator.group might not be enough.
Did you try to run C::B as adminsitrator (from context-menu) ?

Offline GingerDolphin

  • Multiple posting newcomer
  • *
  • Posts: 11
  • Qwerty should be a word.
Re: Help with compiling errors
« Reply #7 on: July 13, 2014, 11:11:54 pm »
@jens
I should have full access to everything, after all I'm an administrator on this computer, unless you meant something else by that. If you did, then I don't know.

If you are on Windows >= 7 being member of the adminstrator.group might not be enough.
Did you try to run C::B as adminsitrator (from context-menu) ?

I am on Vista, but no. I will try that. I mean, I can create the folder, manually put crap in the folder, etc. so I don't know why C::B is acting so weird. I installed it a few weeks ago, and it worked perfectly, no problems, no errors, everything as it should be. I ended up uninstalling so I could clean up the drive, make everything more organized, and when I reinstalled it (with a completely new installer from the website,) It started having these kind of issues, and I haven't been able to run/compile a program since. Was it an update that could have caused it?

EDIT: Also, running in administrator didn't help.
« Last Edit: July 13, 2014, 11:13:38 pm by GingerDolphin »
It took me an hour to register here. I was a robot for an hour, don't mess with a former robot O.O

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Help with compiling errors
« Reply #8 on: July 13, 2014, 11:20:46 pm »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline GingerDolphin

  • Multiple posting newcomer
  • *
  • Posts: 11
  • Qwerty should be a word.
Re: Help with compiling errors
« Reply #9 on: July 14, 2014, 02:19:54 am »
Yes, the compiler is all set up correctly according to every tutorial and link and whatever else I could find within an hour. Everything seems to be in place, but the error still occurs every time. Earlier, I thought I'd fixed it, but then I got the "no such file or directory exists" error, but now it's back to this.
It took me an hour to register here. I was a robot for an hour, don't mess with a former robot O.O

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Help with compiling errors
« Reply #10 on: July 14, 2014, 02:28:21 am »
Posting a build log might help; till you post one we will not know.

I suggest posting the normal info.
Like CB Version, OS Name, Compiler name and version.

Tim S.


Post a build log or I will report you as a Troll!!!

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline GingerDolphin

  • Multiple posting newcomer
  • *
  • Posts: 11
  • Qwerty should be a word.
Re: Help with compiling errors
« Reply #11 on: July 14, 2014, 04:01:35 am »
Alright, gosh.

OS: Windows Vista Home Basic, 32 bit.

Code::Blocks version: 13.12

compiler name: Well, it's the default, GNU GCC/MingW, version 4.7.1

program I was trying to run (in case you can find something wrong with the code itself):
-----------------------------
#include <iostream>

using namespace std;

int main()
{
    cout << "Hello world!" << endl;
    return 0;
}
-----------------------------

complete build log(as shown in build log tab at bottom of the window)

-------------- Build: Debug in Hassentopia (compiler: GNU GCC Compiler)---------------

mingw32-c++.exe -Wall -fexceptions -g -ID:\ProjectH\Hassentopia\bin -ID:\ProjectH\Hassentopia\obj -c D:\ProjectH\Hassentopia\files\main.cpp -o obj\Debug\main.o
Execution of 'mingw32-c++.exe -Wall -fexceptions -g -ID:\ProjectH\Hassentopia\bin -ID:\ProjectH\Hassentopia\obj -c D:\ProjectH\Hassentopia\files\main.cpp -o obj\Debug\main.o' in 'D:\ProjectH\Hassentopia\files' failed.

sorry for coming off as fake to you, I'm just trying to do what you tell me to do.
It took me an hour to register here. I was a robot for an hour, don't mess with a former robot O.O

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Help with compiling errors
« Reply #12 on: July 14, 2014, 04:25:29 am »
Why is CB trying to run "mingw32-c++.exe" instead of the normal "mingw32-g++.exe"?
Do you know?

Edit2: Looks like you did change the settings; but, the c++.exe should work.
Did you change the toolchain setting?
What are the toolchain settings?

Where is the compiler installed? What path to it?
What does CB has as the path to the compiler?

Edit1:
Why is these options added "-ID:\ProjectH\Hassentopia\bin" and "-ID:\ProjectH\Hassentopia\obj"
Did you add random compiler search folders or what?

Edit3:
Quote
Using MinGW GCC in Code::Blocks (CB) problems types:
   1. Toolchain configuration issues
      a. CB configuration is corrupted
      b. CB Toolchain not configured correctly.
   2. Compiler Installation issues
      a. Compiler not installed
      b. Compiler only partly installed
      c. Compiler installation damaged
   3. Compiler Conflict issues
      a. Cygwin in the system path
      b. MSys in the system path
      c. Special folder exists on your computer.
         i. X:\mingw (where X can be any drive letter)
         ii. X:\mingw32 (where X can be any drive letter)
   4. CB project settings issues
      a. Project/target is not using the correct Compiler
      b. Project is using more than one Compiler
   5. Security related issues
      a. Windows security
      b. Anti-Virus caused issues

I suggest checking for "CB Toolchain not configured correctly." I posted directions for that in the past here.
http://forums.codeblocks.org/index.php/topic,18075.0.html

Tim S.
« Last Edit: July 14, 2014, 04:48:51 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline GingerDolphin

  • Multiple posting newcomer
  • *
  • Posts: 11
  • Qwerty should be a word.
Re: Help with compiling errors
« Reply #13 on: July 14, 2014, 04:57:28 am »
Hahahaha... okay, sorry. So down there it's saying it's looking for the compiler in those folders? I was under the impression that's where the files it's trying to compile are(which IS where the files I want compiled are.) So, what did I do wrong?

Yes, the toolchain setting is changed like you said, but here is what it says anyway(under settings > compiler> global compiler settings > toolchaing executables, right?)

EDIT: everything was default, except for what you told me to change(the install location)

D:\Code_Blocks\MinGW

C compiler: mingw32-gcc.exe

C++ compiler: mingw32-c++.exe

linker for dynamic libs: mingw32-g++.exe

linker for static libs: ar.exe

debugger: GDB/CDB debugger : default

resource compiler: windres.exe

make program: mingw32-make.exe
« Last Edit: July 14, 2014, 05:04:57 am by GingerDolphin »
It took me an hour to register here. I was a robot for an hour, don't mess with a former robot O.O

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Help with compiling errors
« Reply #14 on: July 14, 2014, 05:03:20 am »
Do you know how to open a cmd.exe window if yes do so.

Enter each line in the code box one at a time.
Code
cd /d D:\Code_Blocks\MinGW\bin
mingw32-c++.exe -v

You should get something as a result what is the result?

Edit: When I mistype the command I got this as the result
Code
C:\Program Files\CodeBlocks_13_12\MinGW\bin>mingw32-cgg++.exe -v
'mingw32-cgg++.exe' is not recognized as an internal or external command,
operable program or batch file.

Tim S.
« Last Edit: July 14, 2014, 05:06:52 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline GingerDolphin

  • Multiple posting newcomer
  • *
  • Posts: 11
  • Qwerty should be a word.
Re: Help with compiling errors
« Reply #15 on: July 14, 2014, 06:02:06 am »
typed it in word for word, one line at a time. this is the result:

mingw32-c++.exe: fatal error: no input files
compilation terminated.
It took me an hour to register here. I was a robot for an hour, don't mess with a former robot O.O

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Help with compiling errors
« Reply #16 on: July 14, 2014, 04:27:14 pm »
typed it in word for word, one line at a time. this is the result:

mingw32-c++.exe: fatal error: no input files
compilation terminated.

Did you do the -v or not?

Because if you did the dash v you [likely] have a bad Mingw Installation.

Tim S.
« Last Edit: July 14, 2014, 06:21:35 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Help with compiling errors
« Reply #17 on: July 14, 2014, 07:05:14 pm »
I created a batch file for you to try; please read that thread but do NOT post in it.
Since this thread is already started.

http://forums.codeblocks.org/index.php/topic,19453.msg132925.html#msg132925

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline GingerDolphin

  • Multiple posting newcomer
  • *
  • Posts: 11
  • Qwerty should be a word.
Re: Help with compiling errors
« Reply #18 on: July 14, 2014, 11:49:26 pm »
Yeah, I probably don't have it installed correctly. When I run the batch file, (and I did make sure to set the path to the MinGW installation) it comes up with a lot of "No such file or directory" errors. If you need all the text from the cmd window, I can edit the post.

I am using the MinGW that comes with Code::Blocks-- is that bad? Are there known installation problems? Everytime I re-install Code::Blocks, it messes up, should I get a new installer and try that? Or just get MinGW by itself and use that?
« Last Edit: July 14, 2014, 11:52:34 pm by GingerDolphin »
It took me an hour to register here. I was a robot for an hour, don't mess with a former robot O.O

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Help with compiling errors
« Reply #19 on: July 14, 2014, 11:54:59 pm »
Yeah, I probably don't have it installed correctly. When I run the batch file, (and I did make sure to set the path to the MinGW installation) it comes up with a lot of "No such file or directory" errors. If you need all the text from the cmd window, I can edit the post.

I am using the MinGW that comes with Code::Blocks-- is that bad? Are there known installation problems? Everytime I re-install Code::Blocks, it messes up, should I get a new installer and try that? Or just get MinGW by itself and use that?

No need for the result; I suggest uninstalling all MinGW GCC installations.
Then rebooting the computer.
Then installing a single MinGW GCC.
Edit: I suggest installing MinGW by itself using a TDM installer. http://sourceforge.net/projects/tdm-gcc/?source=directory

Tim S.
« Last Edit: July 14, 2014, 11:56:46 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline GingerDolphin

  • Multiple posting newcomer
  • *
  • Posts: 11
  • Qwerty should be a word.
Re: Help with compiling errors
« Reply #20 on: July 15, 2014, 12:26:13 am »
Is there a way to install Code::Blocks without MinGW so in the future I can get MinGW by itself without deleting the one already installed?
It took me an hour to register here. I was a robot for an hour, don't mess with a former robot O.O

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Help with compiling errors
« Reply #21 on: July 15, 2014, 12:32:36 am »
Is there a way to install Code::Blocks without MinGW so in the future I can get MinGW by itself without deleting the one already installed?

Just install Code::Blocks with an installer that does not have mingw in the filename.

I would suggest codeblocks-13.12-setup.exe.

Tim S
« Last Edit: July 15, 2014, 12:35:49 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline GingerDolphin

  • Multiple posting newcomer
  • *
  • Posts: 11
  • Qwerty should be a word.
Re: Help with compiling errors
« Reply #22 on: July 22, 2014, 02:30:13 am »
Sorry for the delay, I was in Illinois for a week :)

I came to this forum with the first impression that the admins here were complete asses.
After actually looking at some posts, and the experience here, I just realize you have to deal with idiots all the time. If I had to go through all those posts and deal with things like that, I'd be a little quick to get aggravated too.

Thank you for putting the time into helping me out. It turned out to be something wrong with my hard drive, but the issue seems to be fixed now. Still, thank you all for the help, you all sacrificed a good bit of time dealing with/educating me  ;D
It took me an hour to register here. I was a robot for an hour, don't mess with a former robot O.O