Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: racer319 on April 29, 2012, 09:30:23 pm

Title: Program works on Dev-Cpp but not C::B
Post by: racer319 on April 29, 2012, 09:30:23 pm
Hey, I'm having some trouble getting C::B to compile anything. I'm on Windows XP using the GNU GCC Compiler. I just uninstalled and reinstalled all of C::B after having trouble getting it to work previously. I have some experience using Dev-Cpp and i'm trying to switch over. Here's my code:

Code
#include <iostream>

using namespace std;

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

I switched the compiler log settings to full command line and the error is:

Code
mingw32-g++.exe  -o bin\Debug\HelloWorld.exe obj\Debug\main.o    C:\SDL\Win32Lib\lib\SDL.lib 
mingw32-g++.exe: C:\SDL\Win32Lib\lib\SDL.lib: No such file or directory
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings

I don't understand why i'm getting an error related to SDL because I'm not even using SDL. Can you help?
Title: Re: Program works on Dev-Cpp but not C::B
Post by: zabzonk on April 29, 2012, 09:35:45 pm
At a guess, you created an "SDL project" when you should really have created a "Console application" in the File|New|Project dialog.
Title: Re: Program works on Dev-Cpp but not C::B
Post by: stahta01 on April 29, 2012, 09:40:09 pm
Note: The below fixes user caused issues like adding library setup information to the Compiler Configuration.

Edit: With Code::Blocks NOT runnning
Delete or rename the Code::Blocks config file and see if error goes away.
Filename defaults to "default.conf"

Look inside the "%APPDATA%\codeblocks" folder.

Tim S.

PS: DO NOT PM me, again!!!
Or, I will request that you be banned.

Title: Re: Program works on Dev-Cpp but not C::B
Post by: racer319 on April 29, 2012, 11:20:35 pm
At a guess, you created an "SDL project" when you should really have created a "Console application" in the File|New|Project dialog.

No, I also thought that was the problem but it's just a regular console application. I was working in SDL earlier and was getting this error so i decided to just try a simple hello world program and I got the same error. I have since reinstalled CB but still got the same error. It seems to be a compiler issue, but I reinstalled the compiler as well (the one that comes with CB). Do you have any other suggestions?

PS: DO NOT PM me, again!!!
Or, I will request that you be banned.

I'm completely new to this site and I don't entirely know how it works. I saw that you were online and you looked like you knew what you were talking about, so I messaged you for help. I was under the impression that a help forum is a place where people help eachother. I was simply asking for your assistance, and I don't understand the hostility. Chill out, and please don't be rude. If you don't want me to message me, you can just say so.

Thank you, however, for trying to help me. If I delete the Code::Blocks config file could that possibly cause C::B not to run at all? Or would I just have to put it back in from the recycle bin.

PS: I deleted "default.conf" from the AppData folder, still getting the same error. Should I uninstall/reinstall again? And if so, which files need to be uninstalled. Again, thanks for the help!
Title: Re: Program works on Dev-Cpp but not C::B
Post by: stahta01 on April 29, 2012, 11:45:37 pm
I hope you now know the difference between personal messaging (PM) and posting a message on a forum.

After being PM about a dozen times from complete idiots(You were not a complete idiot; some of the others questions had nothing to do with site);
I have no tolerance for what I considered rude behavior.
If you wish to avoid comments like mine, I suggest reading http://www.catb.org/~esr/faqs/smart-questions.html (http://www.catb.org/~esr/faqs/smart-questions.html).

Tim S.
Title: Re: Program works on Dev-Cpp but not C::B
Post by: racer319 on April 29, 2012, 11:56:48 pm
I do know the difference.

I'm sorry to bother you, I was just hoping you could help me out. I tried what you recommended, still getting the same error. Do you have any other ideas?
Title: Re: Program works on Dev-Cpp but not C::B
Post by: oBFusCATed on April 30, 2012, 12:04:46 am
racer319:
Check the linker settings of your target, project and in the global compiler options. If you don't know where can you find them, please read the manual.
Title: Re: Program works on Dev-Cpp but not C::B
Post by: racer319 on April 30, 2012, 12:11:24 am
racer319:
Check the linker settings of your target, project and in the global compiler options. If you don't know where can you find them, please read the manual.

Oh. My. God. I'm an idiot. That fixed it. I had a nonexistant SDL library in my linker settings. Well, thank you very much, I feel stupid. Have a good day :)