User forums > Help

Code compiles in one dir, not in another

(1/1)

weedenbc:
Very weird problem.  I have a small c project I have been working on and today I ran into an error I had not seen before:


--- Quote ---In function 'int main ()'
error: invalid conversion from 'void' to 'double"
--- End quote ---

Here's the offending line of code:


--- Code: ---period = malloc (sizeof *period * 5000);
--- End code ---

After not being able to track down the error in the source code, I reverted back to an older known working version and it compiled just fine.  Here's the problem.  It compiles just fine in the C:\Temp directory but when I copy the same source file to where my code lives D:\My Documents\Coding\ the invalid conversion error comes back.

Any idea why this would be happening?  I am just opening the C file and clicking build/run, it's not part of a project or anything.  Like I said, in one dir the same exact source file compiles just fine but not in another dir.  That's why I think this may be a Code Blocks config issue and not a bug, although my code is far from awesome.

I did some troubleshooting and it compiles/runs from any dir except one that has a space in the name.  Any ideas?

------
Brian

Navigation

[0] Message Index

Go to full version