pkout
pkout

Reputation: 6736

Visual Studio C++ 2010 compilation errors in release mode

I have a project in Visual Studio 2010 (C++ project) that compiles without a problem in the debug mode, but gives me a torrent of strange "syntax" errors in Release mode. The errors are like these:

c:\program files\point grey research\flycapture2\include\Error.h(38): error C2059: syntax error : 'string'
1>c:\program files\point grey research\flycapture2\include\Error.h(39): error C2146: syntax error : missing ';' before identifier 'Error'
1>c:\program files\point grey research\flycapture2\include\Error.h(39): error C2470: 'Error' : looks like a function definition, but there is no parameter list; skipping apparent body
1>c:\program files\point grey research\flycapture2\include\BusManager.h(56): error C2059: syntax error : 'string'
1>c:\program files\point grey research\flycapture2\include\BusManager.h(57): error C2146: syntax error : missing ';' before identifier 'BusManager'

FlyCapture is a library that my code uses. I carefully checked the paths to the included header directories and lib libraries and they are correct. I also changed the library file names such that they don't contain the "d" (for debug). I also checked my code for precompiler _DEBUG statements. I didn't find a single one. This is very frustrated. Any ideas what else I should check? I am compiling in x64 mode.

EDIT:

The first error points to "class FLYCAPTURE2_API Error" line in the library header file pasted below (I didn't even write this library myself and it works in the debug mode):

namespace FlyCapture2
{
    struct ErrorImpl;

    /**
     * The Error object represents an error that is returned from the library.
     * Overloaded operators allow comparisons against other Error objects or
     * the ErrorType enumeration.
     */
    class FLYCAPTURE2_API Error
    {
    public:

        /**
         * Default constructor.
         */
        Error();

        /**
         * Copy constructor.
         */
        Error( const Error& error );

        /**
         * Default destructor.
         */
        virtual ~Error();

That's what's strange to me. There should be no problem with this code.

Upvotes: 0

Views: 474

Answers (1)

pkout
pkout

Reputation: 6736

I got it. I was able to find a sample project that came with the FlyCapture2 library that is configured to compile in Release mode. It contained several switches that were different from the debug mode. So my paths were correct, but there were some compiler switches and library ignores to enable. If this happens to anybody using FlyCapture2, see the sample project(s) and switch them to the release mode, then compare your project's release mode against theirs. Thank you guys!

Upvotes: 0

Related Questions