Thread: stdbool.h in Visual Studio C++ Express 2008 ( standard C code)

  1. #1
    Registered User
    Join Date
    Sep 2006
    Location
    Beaverton, Oregon, United States
    Posts
    176

    stdbool.h in Visual Studio C++ Express 2008 ( standard C code)

    ok I got this working once before. Off the net I grabbed a stdbool.h header file that was recommended to use with VS. In admin mode I plopped it in Microsoft Visual Studio 9.0/VC/ include folder and presto! I was able to use stdbool.h without a hitch.

    I had to do a system restore about a week ago. And setting everything back up again. Now when I try the above stunt, I get this error from VS:

    Code:
    ------ Build started: Project: Program 7.4, Configuration: Debug Win32 ------
    Embedding manifest...
    .\Debug\Program 7.4.exe.intermediate.manifest : general error c1010070: Failed to load and parse the manifest. The system cannot find the file specified.
    Build log was saved at "file://c:\Documents and Settings\Cruisin'\My Documents\Visual Studio 2008\Projects\Program 7.4\Program 7.4\Debug\BuildLog.htm"
    Program 7.4 - 1 error(s), 0 warning(s)
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
    This sorta thing is so frustrating. gah. Here is the stdbool.h header code:

    Code:
    #ifndef STDBOOL_H_
    #define STDBOOL_H_
    
    /**
     * stdbool.h - ISO C99 Boolean type
     * Author    - Bill Chatfield
     * E-mail    - bill underscore chatfield at yahoo dot com
     * Copyright - You are free to use for any purpose except illegal acts
     * Warrenty  - None: don't blame me if it breaks something
     *
     * In ISO C99, stdbool.h is a standard header and _Bool is a keyword, but
     * some compilers don't offer these yet. This header file is an 
     * implementation of the standard ISO C99 stdbool.h header file. It checks
     * for various compiler versions and defines things that are missing in
     * those versions.
     *
     * The GNU and Watcom compilers include a stdbool.h, but the Borland
     * C/C++ 5.5.1 compiler and the Microsoft compilers do not.
     * 
     * See http://predef.sourceforge.net/precomp.html for compile macros.
     */
    
    /**
     * Borland C++ 5.5.1 does not define _Bool.
     */
    #ifdef __BORLANDC__
    typedef int _Bool;
    #endif
    
    /**
     * Microsoft C/C++ version 14.00.50727.762, which comes with Visual C++ 2005,
     * and version 15.00.30729.01, which comes with Visual C++ 2008, do not 
     * define _Bool.
     */
    #if defined(_MSC_VER) && _MSC_VER <= 1500
    typedef int _Bool;
    #endif
    
    /**
     * Define the Boolean macros only if they are not already defined.
     */
    #ifndef __bool_true_false_are_defined
    #define bool _Bool
    #define false 0 
    #define true 1
    #define __bool_true_false_are_defined 1
    #endif
    
    #endif /*STDBOOL_H_*/
    Anyone have any ideas what I'm overlooking? And NO I do not want to compile it as a cpp program. I want to just hit the debug button and go if I need to.
    Last edited by A34Chris; 05-21-2011 at 02:31 AM.

  2. #2
    Registered User
    Join Date
    May 2010
    Location
    Naypyidaw
    Posts
    1,314
    Are you sure that is due to stdboo.h header file?

  3. #3
    Registered User
    Join Date
    Sep 2006
    Location
    Beaverton, Oregon, United States
    Posts
    176
    Quote Originally Posted by Bayint Naung View Post
    Are you sure that is due to stdboo.h header file?
    uh... hmmm. Good question lol. I'll double check for errors.

    Here is the program I was using to test to see if my stdbool.h implant worked:

    Code:
    #include <stdio.h> 
    #include <stdbool.h>
    
    // Modified program to generate prime numbers
    
    int main(void)
    
    {
    	int p,i, primes[50], primeIndex=2;
    	bool isPrime;
    	
    	primes[0]=2;
    	primes[1]=3;
    	
    	for (p=5; p<=50; p=p+2)
    	{
    		isPrime = true;
    		
    		for (i=1; isPrime && p/primes[i] >= primes[i];i++)
    			if (p% primes[i] == 0)
    				isPrime = false;
    				
    		if(isPrime == true)
    		{
    			primes[primeIndex]=p;
    			primeIndex++;
    			
    		}
    	}
    	
    	for (i=0; i<primeIndex; i++)
    		printf("%i	", primes[i]);
    		
    		printf("\n");
    		
    		return 0;
    }

    Found a few syntax errors and cleared them up but it still wont budge. It refers to a file not being found. I am assuming its stdbool.h. Maybe I stuck it in the wrong folder?

  4. #4
    Registered User
    Join Date
    Dec 2007
    Posts
    2,675
    The very first response in a Google search of "failed to load and parse the manifest" yields an answer that suggests the use of numbers and spaces in the Project Name can be a cause of this error. You have both numbers and a space.

    Learn to use Google when you get unusual errors. Chances are you're not the first one to encounter the issue.

  5. #5
    Registered User
    Join Date
    Sep 2006
    Location
    Beaverton, Oregon, United States
    Posts
    176
    Quote Originally Posted by rags_to_riches View Post
    The very first response in a Google search of "failed to load and parse the manifest" yields an answer that suggests the use of numbers and spaces in the Project Name can be a cause of this error. You have both numbers and a space.

    Learn to use Google when you get unusual errors. Chances are you're not the first one to encounter the issue.
    Ok thanks! I'll try that. It didnt even occur to me. I automatically assumed it was a problem with the header file.

  6. #6
    Registered User
    Join Date
    Sep 2006
    Location
    Beaverton, Oregon, United States
    Posts
    176
    ok renaming it without space didnt work but cut and pasting the code into a new project solved the problem. Thanks guys.

  7. #7
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    From the original error messages, I'd have to bet it's looking for a .manifest file to add into the program's resources and can't find it.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Visual Studio 2010 and stdbool.h
    By Jaymond Flurrie in forum C Programming
    Replies: 23
    Last Post: 07-02-2010, 06:55 AM
  2. writing windows dlls using visual studio 2008 express
    By xixpsychoxix in forum Windows Programming
    Replies: 17
    Last Post: 01-22-2009, 03:53 AM
  3. Visual C++ 2008 Express questions...
    By edomingox in forum C++ Programming
    Replies: 4
    Last Post: 10-03-2008, 08:35 AM
  4. visual c++ 2008 express
    By manzoor in forum C++ Programming
    Replies: 2
    Last Post: 02-07-2008, 05:31 AM
  5. Visual Studio Express 2008 problems.
    By Normac in forum C++ Programming
    Replies: 2
    Last Post: 08-08-2007, 10:41 AM