User forums > Help

Strange compiling behavior

(1/3) > >>

Coywolf:
Hello, I've noticed something strange with compiling a project of mine. I don't know if this has anything to do with the compiler or with code blocks. Basically, I've noticed that I'm getting different compile results depending on where my file is located. Originally, I had my project buried somewhere in Documents. It gave errors there. But for various tests I was doing, I decided to make a copy. I just saved it on the Desktop. Once I tried compiling there, it compiled fine. All the errors say

--- Code: ---error: invalid conversion from `void*' to `int*'
--- End code ---
for every time I had a line like

--- Code: ---int *setA = malloc(1000);
--- End code ---
The files are EXACTLY the same in both places. In fact, continuing to test, I started doing a save as in each folder on the way to its original location of

--- Code: ---C:\Users\****\Documents\CS 240\project 3\project 3\project3.c
--- End code ---
It started giving those errors when I got to CS 240. So basically I'm wondering if this is a compiler error or a code blocks error, and if anyone knows how to fix it. Or even if I should be getting those errors or if it should actually be ignoring them.
I'm running code blocks 8.02, just the normal download, not nightly. 64-bit Vista. I got this with the standard C compiler, though I also tried downloading MinGW 5.1.6 and got the same behavior.

EDIT: realized I posted the results backwards. I was getting errors when it was in Documents, and not getting them on the Desktop. I updated the post

oBFusCATed:
Please search the forum before you ask...
The compiler in the 8.02 release does not work on Vista!
Also some compilers have problems with spaces in paths... :?

Devs/site admins: can you add a message to the main page/download page that the compiler is broken on vista?

zabzonk:
Also, check that you are compiling your source files as C and not C++. C++ does not provide an implicit cast from void * to other pointer types.

Coywolf:
I read the forums and saw things saying the compiler didnt work, which is why I tried downloading another, but continued to get the same behavior.

How do I check how its compiling? I just click the build button, I don't know if its compiling as C or C++

I guessed the spaces thing mightve been the problem, but it doesnt seem to make sense that it would either give errors or not. It would seem to me like it should be unable to run the compiler at all due to the file path

zabzonk:
Firstly, check that you really know which compiler you are using. To do this go to the Settings menu and select Compiler & Debugger. Then in the dialog that pops up, select Toolchain Executables and check that the directory it refers to is the one of the latest MinGW you say you installed, and not the one that came with the original CB installation. If it isn't change it so that it is and try doing a complete rebuild of your project (select Rebuild from Build menu)

If this still fails, please post here the command that gets executed by Code::Blocks, using copy and paste from the CB Build Log tab.

Navigation

[0] Message Index

[#] Next page

Go to full version