Author Topic: Lots and lots of problems with projects...  (Read 6523 times)

Offline aRealDIC

  • Single posting newcomer
  • *
  • Posts: 4
Lots and lots of problems with projects...
« on: May 18, 2014, 07:12:23 pm »
Okay, so I just switched over from Visual C++ (Visual Studios) and hardly any of my programs I made before in Visual Studios will compile in Code::Blocks...

I've had countless errors and problems ranging from header files not being found, all the way to things not working with no real reason to it at all.

Here is my problem atm. I am trying to make my program check if an internet connection is available.

My code:
Code
#include <Windows.h>
#include <string>
#include <wininet.h>

int main(){
InternetCheckConnection("google.com", FLAG_ICC_FORCE_CONNECTION, 0);
}

Normally, there is supposed to be a #pragma here including the wininet.lib but #pragma's are always ignored in C::B so I just included the library itself in the project build properties.

It gives me this error when I try to compile.
Code
error: 'FLAG_ICC_FORCE_CONNECTION' was not declared in this scope|

Funny thing is, FLAG_ICC_FORCE_CONNECTION is the correct parameter, and is also the only parameter for this function... C::B has done nothing but given me problems ever since I downloaded it.. What do I do?
« Last Edit: May 18, 2014, 07:14:25 pm by aRealDIC »

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Lots and lots of problems with projects...
« Reply #1 on: May 18, 2014, 07:38:36 pm »
Be aware that C::B is not a compiler, "just" an IDE that can work with many compilers.

Your projects are most likely VS-projects and you probably use them with MinGW. This will not work without some tweaking and clearing VS-specific stuff.
Alternatively you can use the VS binaries (compiler, linker etc.) with Code::Blocks.

I can't give any more help, because I do not use MS-software if it is not absolutely needed.

Offline aRealDIC

  • Single posting newcomer
  • *
  • Posts: 4
Re: Lots and lots of problems with projects...
« Reply #2 on: May 18, 2014, 07:40:53 pm »
Be aware that C::B is not a compiler, "just" an IDE that can work with many compilers.

Your projects are most likely VS-projects and you probably use them with MinGW. This will not work without some tweaking and clearing VS-specific stuff.
Alternatively you can use the VS binaries (compiler, linker etc.) with Code::Blocks.

I can't give any more help, because I do not use MS-software if it is not absolutely needed.


I am using the MingW IDE but I switched it to the MS Visual C++ compiler, and still nothing :/

Honestly, I'm about to just switch back over to Visual Studio because headers don't work, and none of my other programs will compile either.

Offline aRealDIC

  • Single posting newcomer
  • *
  • Posts: 4
Re: Lots and lots of problems with projects...
« Reply #3 on: May 18, 2014, 07:41:58 pm »
I really don't want to switch back over either.. VS has turned to shit ever since they released VS 2012.

Offline aRealDIC

  • Single posting newcomer
  • *
  • Posts: 4
Re: Lots and lots of problems with projects...
« Reply #4 on: May 18, 2014, 07:57:46 pm »
OKAY! For the problem I was having, I actually figured out a fix out of straight luck..
Instead of using the MicroShit flag for the parameter, I just did this:
Code
InternetCheckConnection("http://google.com", 1, 0)
Actually works too. I just need to fix headers now.