Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: MoniqueDumont on January 21, 2014, 06:28:23 pm

Title: Strange problem with compiler
Post by: MoniqueDumont on January 21, 2014, 06:28:23 pm
Hello,
I am running Code::Blocks version 13.13 on windows 8.
(8.0). The compiler I use is GNU GCC compiler.

When I open a .cbp, Code::Blocks show this error :

(http://i.imgur.com/vk0RGrp.png)


but the fact is that i'm not using Microsoft Visual C++ Toolkit 2003, as you can see on the following pictures, i'm running GNU GCC Compiler, set as default :


(http://i.imgur.com/B53xB2Q.png)
(http://i.imgur.com/4wRf0ok.png)
(http://i.imgur.com/BhQlr3R.png)
(http://i.imgur.com/BEmS3rs.png)

Build log:
Code
Probably the toolchain path within the compiler options is not setup correctly?! (Do you have a compiler installed?)
Goto "Settings->Compiler...->Global compiler settings->Microsoft Visual C++ Toolkit 2003->Toolchain executables" and fix the compiler's setup.
Skipping...
Nothing to be done (all items are up-to-date).

Thank you for your attention.
Title: Re: Strange problem with compiler
Post by: Jenna on January 21, 2014, 07:34:12 pm
Are yo sure, that neither the project nor any target inside uses MSVC ?
Title: Re: Strange problem with compiler
Post by: MoniqueDumont on January 21, 2014, 09:53:09 pm
When I set GNU GCC or any of the others compilers as default in Settings > Compiler, and click on OK, Code::Blocks sends me the error about MSVC.
So I tried as you said, to look if nothing's using MSVC. In Project > Build Options > Debug/Release, I set GNU GCC and get a new error :

My build messages are :
Code
||=== Build: Debug in Project title (compiler: GNU GCC Compiler) ===|
 \W3||No such file or directory|
 \Zi||No such file or directory|
 \D_DEBUG||No such file or directory|
 \MDd||No such file or directory|
||=== Build failed: 4 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|

And my build log is :
Code
mingw32-gcc.exe: error: /W3: No such file or directory
mingw32-gcc.exe: error: /Zi: No such file or directory
mingw32-gcc.exe: error: /D_DEBUG: No such file or directory
mingw32-gcc.exe: error: /MDd: No such file or directory
Process terminated with status 1 (0 minute(s), 0 second(s))
4 error(s), 0 warning(s) (0 minute(s), 0 second(s))
Title: Re: Strange problem with compiler
Post by: stahta01 on January 21, 2014, 10:27:01 pm
So, the project was using MSVC.

You need to fix the project or install MSVC (and configure CB toolchain).

Make a decision.

Tim S.


Title: Re: Strange problem with compiler
Post by: MoniqueDumont on January 21, 2014, 10:39:00 pm
Yes but the upper logs are the logs I get when I set GNU GCC in the project's build options. Is that what you meant ? What  do these logs mean ?
Title: Re: Strange problem with compiler
Post by: stahta01 on January 21, 2014, 10:41:52 pm
Yes but the upper logs are the logs I get when I set GNU GCC in the project's build options. Is that what you meant ? What  do these logs mean ?

Have you made the decision? If yes, what did you decide to do?

Edit: To fix the project; remove the MSVC options that are in the Compiler/Linker other options section in the project.

Tim S.
Title: Re: Strange problem with compiler
Post by: MoniqueDumont on January 21, 2014, 11:17:35 pm
Okay now I'm getting

Code
||=== Build: Debug in Problem 22 (compiler: GNU GCC Compiler) ===|
ld.exe||cannot find -lmsvcrtd.lib|
ld.exe||cannot find -lmsvcprtd.lib|
||=== Build failed: 2 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|

I removed the options here :

(http://i.imgur.com/3OkBE7d.png)

and in Debug/Release, is that what you meant ?
Title: Re: Strange problem with compiler
Post by: stahta01 on January 22, 2014, 12:54:49 am
Okay now I'm getting

Code
||=== Build: Debug in Problem 22 (compiler: GNU GCC Compiler) ===|
ld.exe||cannot find -lmsvcrtd.lib|
ld.exe||cannot find -lmsvcprtd.lib|
||=== Build failed: 2 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|

I removed the options here :


and in Debug/Release, is that what you meant ?

Yes, for the Compiler "other options"

Also, you need to check the "Linker Settings" other options and remove the libs not supplied by your MinGW GCC.

Tim S.
Title: Re: Strange problem with compiler
Post by: MoniqueDumont on January 22, 2014, 01:02:38 am
Yes, for the Compiler "other options"

Also, you need to check the "Linker Settings" other options and remove the libs not supplied by your MinGW GCC.

Tim S.


I did remove Linker Options too, and I get the errors from the previous post.
Title: Re: Strange problem with compiler
Post by: stahta01 on January 22, 2014, 01:09:44 am
Yes, for the Compiler "other options"

Also, you need to check the "Linker Settings" other options and remove the libs not supplied by your MinGW GCC.

Tim S.


I did remove Linker Options too, and I get the errors from the previous post.

As I said remove the libs in the error you posted from the Linker Settings!

Edit2: You posted a picture of the "Compiler Settings" look to the right and you should see the Linker Settings in the Project Build Options.

Edit: "-lmsvcrtd.lib" A lib that needs removed; likely called "msvcrtd.lib" in the linker settings screen.

Tim S.
Title: Re: Strange problem with compiler
Post by: MoniqueDumont on January 22, 2014, 01:31:40 am
Alright thank you very much it works now !