Page 1 of 1

Building WITH_FFMPEG using MSVC8's IDE

Posted: Wed Nov 22, 2006 4:37 am
by etr9j
Hey everyone,

I'm not sure if this is truly a "bug," but I can across this issue and I didn't know if it's something that needs fixing or it's just VC being weird.

I was compiling Blender with the MSVC8 IDE with FFMPEG and Quicktime enabled. I kept getting this error when I was building BL_imbuf:

Code: Select all

1>..\..\..\source\blender\blenloader\BLO_sys_types.h(60) : error C2632: 'char' followed by 'char' is illegal
1>..\..\..\source\blender\blenloader\BLO_sys_types.h(60) : warning C4091: 'typedef ' : ignored on left of 'char' when no variable is declared
1>..\..\..\source\blender\blenloader\BLO_sys_types.h(61) : error C2632: 'short' followed by 'short' is illegal
1>..\..\..\source\blender\blenloader\BLO_sys_types.h(61) : warning C4091: 'typedef ' : ignored on left of 'short' when no variable is declared
...which continued on to line 68.

So I changed the apparently troublesome section of BLO_sys_types.h from:

Code: Select all

typedef signed __int8  int8_t;
typedef signed __int16 int16_t;
typedef signed __int32 int32_t;
typedef signed __int64 int64_t;

typedef unsigned __int8  uint8_t;
typedef unsigned __int16 uint16_t;
typedef unsigned __int32 uint32_t;
typedef unsigned __int64 uint64_t;
to:

Code: Select all

typedef signed __int8;
typedef signed __int16;
typedef signed __int32;
typedef signed __int64;

typedef unsigned __int8;
typedef unsigned __int16;
typedef unsigned __int32;
typedef unsigned __int64;
Now this seemed to work... The build I made could render to an ffmpeg chosen format. So the big question is if there is a way through the MSVC IDE to allow code not to be changed, or should this be changed and if so, will it impact other build systems?

Re: Building WITH_FFMPEG using MSVC8's IDE

Posted: Wed Nov 22, 2006 7:42 am
by jesterKing
etr9j wrote:

Code: Select all

typedef signed __int8;
typedef signed __int16;
typedef signed __int32;
typedef signed __int64;

typedef unsigned __int8;
typedef unsigned __int16;
typedef unsigned __int32;
typedef unsigned __int64;
Now this seemed to work...
Hmm, this should not really work, as the typedefs here are now totally wrong. Besides, what you've changed is for loading blender files...

I don't know atm what the correct fix is, but the above is not the way.

As an extra note: I build blender with scons/msvc8, with FFMPEG and QuickTime enabled, but I don't get the said error message.

/Nathan

Posted: Wed Nov 22, 2006 2:34 pm
by etr9j
I figured I was messing something up big time... since I make no claim to be a coder. But the odd thing is that I was able to build BL_imbuf once I did that. As for opening a file, that I didn't try so that might now be an issue in the build. So I suppose I am back at square one. I'll take a closer look at my BL_imbuf project file to see if something else is going on.

Anyway, I've seen your scons/msvc8 build which sparked my interest in this problem since I know it can be at least be done via scons.

Posted: Thu Nov 23, 2006 2:32 am
by etr9j
I still can't seem to get a build going. I used Cmake after I got fed up with my project files, and the build went fine with quicktime and ffmpeg. For the record, here is the full BL_imbuf error I get:

Code: Select all

quicktime_import.c
..\..\..\..\lib\windows\QTDevWin\CIncludes\GNUCompatibility/stdint.h(133) : warning C4005: 'SIZE_MAX' : macro redefinition
        C:\Program Files\Microsoft Visual Studio 8\VC\include\limits.h(92) : see previous definition of 'SIZE_MAX'
..\..\..\source\blender\blenloader\BLO_sys_types.h(60) : error C2632: 'char' followed by 'char' is illegal
..\..\..\source\blender\blenloader\BLO_sys_types.h(60) : warning C4091: 'typedef ' : ignored on left of 'char' when no variable is declared
..\..\..\source\blender\blenloader\BLO_sys_types.h(61) : error C2632: 'short' followed by 'short' is illegal
..\..\..\source\blender\blenloader\BLO_sys_types.h(61) : warning C4091: 'typedef ' : ignored on left of 'short' when no variable is declared
..\..\..\source\blender\blenloader\BLO_sys_types.h(62) : error C2632: 'int' followed by 'int' is illegal
..\..\..\source\blender\blenloader\BLO_sys_types.h(62) : warning C4091: 'typedef ' : ignored on left of 'int' when no variable is declared
..\..\..\source\blender\blenloader\BLO_sys_types.h(63) : error C2632: '__int64' followed by '__int64' is illegal
..\..\..\source\blender\blenloader\BLO_sys_types.h(63) : warning C4091: 'typedef ' : ignored on left of '__int64' when no variable is declared
..\..\..\source\blender\blenloader\BLO_sys_types.h(65) : warning C4114: same type qualifier used more than once
..\..\..\source\blender\blenloader\BLO_sys_types.h(65) : error C2632: 'char' followed by 'char' is illegal
..\..\..\source\blender\blenloader\BLO_sys_types.h(65) : warning C4091: 'typedef ' : ignored on left of 'unsigned char' when no variable is declared
..\..\..\source\blender\blenloader\BLO_sys_types.h(66) : warning C4114: same type qualifier used more than once
..\..\..\source\blender\blenloader\BLO_sys_types.h(66) : error C2632: 'short' followed by 'short' is illegal
..\..\..\source\blender\blenloader\BLO_sys_types.h(66) : warning C4091: 'typedef ' : ignored on left of 'unsigned short' when no variable is declared
..\..\..\source\blender\blenloader\BLO_sys_types.h(67) : warning C4114: same type qualifier used more than once
..\..\..\source\blender\blenloader\BLO_sys_types.h(67) : error C2632: 'int' followed by 'int' is illegal
..\..\..\source\blender\blenloader\BLO_sys_types.h(67) : warning C4091: 'typedef ' : ignored on left of 'unsigned int' when no variable is declared
..\..\..\source\blender\blenloader\BLO_sys_types.h(68) : warning C4114: same type qualifier used more than once
..\..\..\source\blender\blenloader\BLO_sys_types.h(68) : error C2632: '__int64' followed by '__int64' is illegal
..\..\..\source\blender\blenloader\BLO_sys_types.h(68) : warning C4091: 'typedef ' : ignored on left of 'unsigned __int64' when no variable is declared
After looking around it seems that there might be a conflict, but I'd rather not take shot in the dark. I'm up for any suggestions. Either way, maybe I should get used to Cmake.

Posted: Wed Nov 29, 2006 9:32 pm
by n_t
Hi etr9j,

sorry to go off topic here - but you seem to use MSVC8 a lot, so I thought you might have some solution for the following problem: I get the error message "unresolved symbol _MainCRTStartup" during linking. Changing the /ENTRY to "main" for linking works, but crashes when starting the .exe file (probably makes, sense, as some windows inits are missing). Do you have an idea where this comes from? Is it possible that the .lib files from the CVS aren't compatible with MSVC8? I previously used MSVC7, where it worked fine... Maybe I also just missed some minor point somewhere?

Thanks in advance, regards,
-> Nils

Posted: Wed Nov 29, 2006 10:12 pm
by etr9j
I think I can help once I get more info:

1) Which Windows SDK are you using? More to the point, do you have the C runtime libraries (msvc(r/p/m)80.dll) installed in the WinSxS folder?
2) Was the linking set to /NOENTRY originally?
3) If you are using the VC8 IDE, did you set up the SDK right? As per http://msdn.microsoft.com/vstudio/expre ... usingpsdk/

Blender does build with VC8 and all the libs link just fine for me. Care to send me the project files (if you're using the IDE) so I can play with them?

Posted: Thu Nov 30, 2006 8:07 am
by jesterKing
Perhaps as a workaround for building problems, you could build with scons for now, and use the IDE to edit the sources - at least scons/msvc8 works (I build daily with it).

/Nathan

Posted: Thu Nov 30, 2006 2:38 pm
by n_t
Hello,

sorry - I forgot to mention, I'm using scons with a configuration similar to config/win32-vc.py, together with Visual Studio 2005 (Version 8.0.50727). The whole compilation works fine, but linking aborts with:
LINK : error LNK2001: unresolved external symbol _mainCRTStartup

The setting "/ENTRY:mainCRTStartup" is the default one, using "/ENTRY:main" links without errors, but doesnt run...

Regards,
-> Nils