Author Topic: Program works on Dev-Cpp but not C::B  (Read 5134 times)

Offline racer319

  • Multiple posting newcomer
  • *
  • Posts: 10
Program works on Dev-Cpp but not C::B
« 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?
Windows XP, GNU GCC Compiler, Code::Blocks 10.05

zabzonk

  • Guest
Re: Program works on Dev-Cpp but not C::B
« Reply #1 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.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7590
    • My Best Post
Re: Program works on Dev-Cpp but not C::B
« Reply #2 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.

« Last Edit: April 29, 2012, 09:54:58 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 racer319

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Program works on Dev-Cpp but not C::B
« Reply #3 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!
« Last Edit: April 29, 2012, 11:25:13 pm by racer319 »
Windows XP, GNU GCC Compiler, Code::Blocks 10.05

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7590
    • My Best Post
Re: Program works on Dev-Cpp but not C::B
« Reply #4 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.

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 racer319

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Program works on Dev-Cpp but not C::B
« Reply #5 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?
Windows XP, GNU GCC Compiler, Code::Blocks 10.05

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Program works on Dev-Cpp but not C::B
« Reply #6 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.
(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 racer319

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Program works on Dev-Cpp but not C::B
« Reply #7 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 :)
Windows XP, GNU GCC Compiler, Code::Blocks 10.05