Horde3D
http://horde3d.org/forums/

Compiling problems with GCC/MinGW
http://horde3d.org/forums/viewtopic.php?f=2&t=483
Page 1 of 2

Author:  Siavash [ 31.08.2008, 06:26 ]
Post subject:  Compiling problems with GCC/MinGW

Hello guys, I have some noob problems with compiling Horde3D Engine.
I'm using GCC/MinGW compiler 3.4.5 to compile H3D engine but I'm getting the following errors on "egCom.h" [line 105 - H3D Engine] and "main.cpp" [line 113, 118, 165 - H3D Utils] [Offical SDK 1.0.0 beta 1]:

Quote:
"egCom.h" [line 105 - H3D Engine]
105) void pushMessage( int level, const char *msg, va_list ap );

error: 'va_list' has not been declared
error: ISO C++ forbids declaration of `ap' with no type


Quote:
"main.cpp" [line 113, 118, 165 - H3D Utils]
113)
if( !(pixelFormat = ChoosePixelFormat( hDC, &pfd )) )
{
return false;
}
undefined reference to `_ChoosePixelFormat@8'

118)
if( !SetPixelFormat( hDC, pixelFormat, &pfd ) )
{
return false;
}
undefined reference to `_SetPixelFormat@12'

165)
DLLEXP void swapBuffers()
{
#ifdef PLATFORM_WIN
if( hDC == 0 || hRC == 0 ) return;

SwapBuffers( hDC );
#endif
}
undefined reference to `_SwapBuffers@4'


[There is not any problems with MSVC compiler]
[I'm using C::B svn 5195 + MinGW/GCC 3.4.5 + GDB 6.8 + WinXP SP2]

Author:  stuckie [ 31.08.2008, 12:09 ]
Post subject:  Re: Compiling problems with GCC/MinGW

When we were compiling Horde with CodeBlocks, all we did was import the Visual Studio Workspace file, then fix the library includes :)

You could try that, cause I never had those errors, and we compiled both the "stable" release and the "unstable" SVN pretty regularly in CodeBlocks.

If that doesn't work, I'll go hunt out our project file for you.. which I need to do anyway as our fiddled with converter code is in there, and I'm about ready to write a HOWTO on extending it after cleaning up my code.

Author:  Siavash [ 31.08.2008, 16:17 ]
Post subject:  Re: Compiling problems with GCC/MinGW

stuckie wrote:
When we were compiling Horde with CodeBlocks, all we did was import the Visual Studio Workspace file, then fix the library includes :)

You could try that, cause I never had those errors, and we compiled both the "stable" release and the "unstable" SVN pretty regularly in CodeBlocks.

If that doesn't work, I'll go hunt out our project file for you.. which I need to do anyway as our fiddled with converter code is in there, and I'm about ready to write a HOWTO on extending it after cleaning up my code.


I think there isn't any problems with library includes :(

Author:  stuckie [ 31.08.2008, 17:45 ]
Post subject:  Re: Compiling problems with GCC/MinGW

The "undefined references" mean it can't find the function call that the headers are referring to.. be it within .C/.CPP files or DLL files.. so this is sortof a library problem.

"va_list" is in a standard header - stdarg.h specifically.

Which MinGW release did you grab? there's a number of them about... the Ogre3D crew have one, there's another that comes with Code::Blocks, and there's the official ones from the MinGW team. I've also seen user hacks to get GCC 4.x running as well... might just be you've a bad release.

The one I use is the Ogre3D version as they did some fiddling to it for allowing exceptions across the DLL boundaries, and may have fixed some other bugs at the same time.

I'll put up my workspace and project files for you tomorrow if you've still no joy.. I've been cleaning out my computers today so there's stuff everywhere at the moment.

Author:  Siavash [ 31.08.2008, 19:26 ]
Post subject:  Re: Compiling problems with GCC/MinGW

stuckie wrote:
The "undefined references" mean it can't find the function call that the headers are referring to.. be it within .C/.CPP files or DLL files.. so this is sortof a library problem.

"va_list" is in a standard header - stdarg.h specifically.


Thanks a lot , the problem with "egCom.h" has been resolved by adding the "#include <stdarg.h>". :P

But still I have those problems with H3D Utils :x

stuckie wrote:
Which MinGW release did you grab? there's a number of them about... the Ogre3D crew have one, there's another that comes with Code::Blocks, and there's the official ones from the MinGW team. I've also seen user hacks to get GCC 4.x running as well... might just be you've a bad release.


I'm using the latest Offical MinGW/GCC 3.4.5 .

stuckie wrote:
The one I use is the Ogre3D version as they did some fiddling to it for allowing exceptions across the DLL boundaries, and may have fixed some other bugs at the same time.

I'll put up my workspace and project files for you tomorrow if you've still no joy.. I've been cleaning out my computers today so there's stuff everywhere at the moment.


Thanks a lot my friend :oops:

Author:  phoenix64 [ 31.08.2008, 20:11 ]
Post subject:  Re: Compiling problems with GCC/MinGW

Those symbols should be in gdi32.

Author:  Siavash [ 31.08.2008, 20:33 ]
Post subject:  Re: Compiling problems with GCC/MinGW

phoenix64 wrote:
Those symbols should be in gdi32.

Do you know how to solve this problem :?:

Author:  phoenix64 [ 31.08.2008, 21:44 ]
Post subject:  Re: Compiling problems with GCC/MinGW

Add the library ((lib)gdi32.a?) to the project?

Author:  Volker [ 31.08.2008, 22:47 ]
Post subject:  Re: Compiling problems with GCC/MinGW

Siavash wrote:
stuckie wrote:
The "undefined references" mean it can't find the function call that the headers are referring to.. be it within .C/.CPP files or DLL files.. so this is sortof a library problem.

"va_list" is in a standard header - stdarg.h specifically.

Thanks a lot , the problem with "egCom.h" has been resolved by adding the "#include <stdarg.h>". :P

I guess that's something we can add to the SVN since it shouldn't hurt any of the platforms, should it?

Author:  swiftcoder [ 01.09.2008, 02:43 ]
Post subject:  Re: Compiling problems with GCC/MinGW

Volker wrote:
Siavash wrote:
stuckie wrote:
The "undefined references" mean it can't find the function call that the headers are referring to.. be it within .C/.CPP files or DLL files.. so this is sortof a library problem.

"va_list" is in a standard header - stdarg.h specifically.

Thanks a lot , the problem with "egCom.h" has been resolved by adding the "#include <stdarg.h>". :P

I guess that's something we can add to the SVN since it shouldn't hurt any of the platforms, should it?
Only platform it is likely to hurt is Windows, all *nix should have stdarg.h, so as long as you test it, we should be okay ;)

Author:  Siavash [ 01.09.2008, 04:02 ]
Post subject:  Re: Compiling problems with GCC/MinGW

phoenix64 wrote:
Add the library ((lib)gdi32.a?) to the project?

THANX :o ; By adding the "libgdi32.a" to the linker, the second problem has been resolved :idea:

But there is a little problem with vcprojects (H3D Engine, samples, ...), when I'm importing them to the C::B and trying to compile them the following error will be occure :

Quote:
xcopy C:\Documents and Settings\Administrator\My Documents\cb\Horde3D SDK 1.0.0 Beta1\Source\Horde3D Utils\..\..\Build\Horde3D Utils\Release Win32\ C:\Documents and Settings\Administrator\My Documents\cb\Horde3D SDK 1.0.0 Beta1\Source\Horde3D Utils\../../Binaries/Win32 /y
xcopy $(TargetDir)$(RootNamespace)_vc8.lib C:\Documents and Settings\Administrator\My Documents\cb\Horde3D SDK 1.0.0 Beta1\Source\Horde3D Utils\../../Bindings/C++ /y

Invalid number of parameters


I've tried to solve this problem by clearing these scripts from the "Pre/Post build steps" section and it works too, but after compiling it gives unnamed ".exe" or ".dll" files and I must rename them manually :?

Author:  Volker [ 01.09.2008, 07:12 ]
Post subject:  Re: Compiling problems with GCC/MinGW

I guess, CMake is not able to create Code::Blocks projects, is it?

Author:  phoenix64 [ 01.09.2008, 18:30 ]
Post subject:  Re: Compiling problems with GCC/MinGW

Quote:
I guess that's something we can add to the SVN since it shouldn't hurt any of the platforms, should it?

See my thread in the bug reports section.

Quote:
I guess, CMake is not able to create Code::Blocks projects, is it?

It is, but it's relatively difficult to create the project files for the first time (you have to do it from the command line), and the project files suck (only compiling, no debugging in the IDE, no adding files directly in the project etc).

EDIT:
Quote:
Invalid number of parameters

To me that looks as if there are "" missing around the path which contains spaces.

EDIT 2:
I should have looked at that other thread first. Volker comitted the stdarg thing. thx!

Author:  Volker [ 01.09.2008, 18:42 ]
Post subject:  Re: Compiling problems with GCC/MinGW

Siavash wrote:
But there is a little problem with vcprojects (H3D Engine, samples, ...), when I'm importing them to the C::B and trying to compile them the following error will be occure :

Quote:
xcopy C:\Documents and Settings\Administrator\My Documents\cb\Horde3D SDK 1.0.0 Beta1\Source\Horde3D Utils\..\..\Build\Horde3D Utils\Release Win32\ C:\Documents and Settings\Administrator\My Documents\cb\Horde3D SDK 1.0.0 Beta1\Source\Horde3D Utils\../../Binaries/Win32 /y
xcopy $(TargetDir)$(RootNamespace)_vc8.lib C:\Documents and Settings\Administrator\My Documents\cb\Horde3D SDK 1.0.0 Beta1\Source\Horde3D Utils\../../Bindings/C++ /y

Invalid number of parameters


I've tried to solve this problem by clearing these scripts from the "Pre/Post build steps" section and it works too, but after compiling it gives unnamed ".exe" or ".dll" files and I must rename them manually :?

Maybe it helps if you change the place of your files to a directory that does not contain spaces.

Author:  Siavash [ 02.09.2008, 11:46 ]
Post subject:  Re: Compiling problems with GCC/MinGW

Sorry, I've tried those trix (using "" and changing location) but they didn't solve the problem.
By changing the project location to another place (directory that does not contain spaces) compiler says : Invalid number of parameters
By using "" compiler says: Invalid path :x

Page 1 of 2 All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/