Logo by haltenny - Contribute your own Logo!

END OF AN ERA, FRACTALFORUMS.COM IS CONTINUED ON FRACTALFORUMS.ORG

it was a great time but no longer maintainable by c.Kleinhuis contact him for any data retrieval,
thanks and see you perhaps in 10 years again

this forum will stay online for reference
News: Visit us on facebook
 
*
Welcome, Guest. Please login or register. April 19, 2024, 08:56:32 AM


Login with username, password and session length


The All New FractalForums is now in Public Beta Testing! Visit FractalForums.org and check it out!


Pages: [1]   Go Down
  Print  
Share this topic on DiggShare this topic on FacebookShare this topic on GoogleShare this topic on RedditShare this topic on StumbleUponShare this topic on Twitter
Author Topic: Building Mandelbulber under Windows 7 64bit (with mingw/gcc)  (Read 6526 times)
0 Members and 1 Guest are viewing this topic.
rh73
Forums Freshman
**
Posts: 10


« on: April 11, 2014, 10:58:40 PM »

I want to build Mandelbulber under Windows 7 64bit and wonder about the necessary steps to setup a development environment. Krzysztof told me that I'd need mingw and gtk+2.0 so here's what I did. (paste from a mail I sent him, but maybe somebody else who sucessfully built mandelbulber under windows can point me into the right direction, too)

- download and install mingw from mingw.org. I picked the gui installer with a basic msys and gcc, this should be sufficient?
- download and install gtk2.x according to this tutorial: http://www.gtk.org/download/win32_tutorial.php  
(tutorial is for gtk+3.x, I did download 2.x and followed the steps. built and installed gtk and verified it by running the demo application)
- download jpeg library according to this here: http://www.multigesture.net/articles/how-to-upgrade-your-mingw-with-commonly-used-libraries/  (followed only the steps for jpeg)

Now when I try to build mandelbulber (with make all) I get the follwing errors:

Code:
Building file: ../src/Render3D.cpp
Invoking: GCC C++ Compiler
g++ -O3 -ffast-math -Wall -c -fmessage-length=0 `pkg-config --cflags gtk+-2.0 gthread-2.0;` -MMD -MP -MF"src/Render3D.d" -MT"src/Render3D.d"   -o"src/Render3D.o" "../src/Render3D.cpp"
In file included from ../src/Render3D.cpp:39:0:
../src/netrender.hpp:20:0: warning: "_WIN32_WINNT" redefined [enabled by default]
  #define _WIN32_WINNT 0xFFFF
 ^
In file included from c:\mingw\include\_mingw.h:35:0,
                 from c:\mingw\include\windows.h:28,
                 from ../src/Render3D.cpp:13:
c:\mingw\include\sdkddkver.h:154:0: note: this is the location of the previous definition
 #    define _WIN32_WINNT _WIN32_WINNT_WIN2K
 ^
In file included from ../src/netrender.hpp:22:0,
                 from ../src/Render3D.cpp:39:
c:\mingw\include\ws2tcpip.h:38:2: error: #error "ws2tcpip.h is not compatible with winsock.h. Include winsock2.h instead."
 #error "ws2tcpip.h is not compatible with winsock.h. Include winsock2.h instead."
  ^
In file included from ../src/netrender.hpp:22:0,
                 from ../src/Render3D.cpp:39:
c:\mingw\include\ws2tcpip.h:147:8: error: redefinition of 'struct ip_mreq'
 struct ip_mreq {
        ^
In file included from c:\mingw\include\windows.h:93:0,
                 from ../src/Render3D.cpp:13:
c:\mingw\include\winsock.h:315:8: error: previous definition of 'struct ip_mreq'
 struct ip_mreq {
        ^
In file included from ../src/netrender.hpp:22:0,
                 from ../src/Render3D.cpp:39:
c:\mingw\include\ws2tcpip.h:390:13: error: expected initializer before 'freeaddrinfo'
 void WSAAPI freeaddrinfo (struct addrinfo*);
             ^
c:\mingw\include\ws2tcpip.h:391:12: error: expected initializer before 'getaddrinfo'
 int WSAAPI getaddrinfo (const char*,const char*,const struct addrinfo*,
            ^
c:\mingw\include\ws2tcpip.h:393:12: error: expected initializer before 'getnameinfo'
 int WSAAPI getnameinfo(const struct sockaddr*,socklen_t,char*,DWORD,
            ^
make: *** [src/Render3D.o] Error 1

This was from trying to compile the mandelbulber1.21-1.orig tarball. The other tries to include opencl headers which I didn't install yet.
- is it even possible to build mandelbulber1.21-1.orig under Windows 7 64bit?
- how to install the opencl libraries for building mandelbulber-opencl-1.21-1.orig.tar.gz?

Edit: I'm asking specifically about win7 64bit because in another thread I read that the code should be ready to compile for win32 and that throws me off a bit...
« Last Edit: April 12, 2014, 01:55:14 PM by rh73 » Logged
rh73
Forums Freshman
**
Posts: 10


« Reply #1 on: April 12, 2014, 02:46:30 AM »

After some reading I got the impression that I might be using the wrong version of mingw (or rather, the wrong version of gcc?) and downloaded a package from http://win-builds.org/, hoping that it would work out of the box with a 64bit version, as it seems that quaz0r is using that as well. Some errors from earlier are now warnings, but I get new errors now:

Code:
--------------------------------------
Building file: ../src/Render3D.cpp
Invoking: GCC C++ Compiler
g++ -O3 -ffast-math -Wall -c -fmessage-length=0 `pkg-config --cflags gtk+-2.0 gthread-2.0;` -MMD -MP -MF"src/Render3D.d" -MT"src/Render3D.d"   -o"src/Render3D.o" "../src/Render3D.cpp"
In file included from ../src/Render3D.cpp:39:0:
../src/netrender.hpp:20:0: warning: "_WIN32_WINNT" redefined [enabled by default]
  #define _WIN32_WINNT 0xFFFF
 ^
In file included from c:\mingw\msys\1.0\opt\windows_32\i686-w64-mingw32\include\windows.h:9:0,
                 from ../src/Render3D.cpp:13:
c:\mingw\msys\1.0\opt\windows_32\i686-w64-mingw32\include\_mingw.h:229:0: note: this is the location of the previous definition
 #define _WIN32_WINNT 0x502
 ^
In file included from c:\mingw\msys\1.0\opt\windows_32\i686-w64-mingw32\include\ws2tcpip.h:11:0,
                 from ../src/netrender.hpp:22,
                 from ../src/Render3D.cpp:39:
c:\mingw\msys\1.0\opt\windows_32\i686-w64-mingw32\include\winsock2.h:15:2: warning: #warning Please include winsock2.h before windows.h [-Wcpp]
 #warning Please include winsock2.h before windows.h
  ^
In file included from ../src/Render3D.cpp:39:0:
../src/netrender.hpp:24:0: warning: "INET6_ADDRSTRLEN" redefined [enabled by default]
  #define INET6_ADDRSTRLEN 46
 ^
In file included from ../src/netrender.hpp:22:0,
                 from ../src/Render3D.cpp:39:
c:\mingw\msys\1.0\opt\windows_32\i686-w64-mingw32\include\ws2tcpip.h:284:0: note: this is the location of the previous definition
 #define INET6_ADDRSTRLEN 65
 ^
In file included from ../src/Render3D.cpp:39:0:
../src/netrender.hpp:51:75: error: 'int32_t' has not been declared
  bool sendDataToClient(void *data, size_t size, char *command, int index, int32_t identifier);
                                                                           ^
../src/netrender.hpp:54:57: error: 'int32_t' has not been declared
  size_t receiveDataFromClient(char *command, int index, int32_t reqIdentifier);
                                                         ^
../src/netrender.hpp:68:3: error: 'int32_t' does not name a type
   int32_t identifier;
   ^
../src/netrender.hpp:69:3: error: 'uint64_t' does not name a type
   uint64_t size64;
   ^
../src/netrender.hpp:73:2: error: 'uint16_t' does not name a type
  uint16_t CRC_Fletcher16( uint8_t const *data, size_t bytes);
  ^
../src/netrender.hpp:86:3: error: 'int32_t' does not name a type
   int32_t lastIdentifier;
   ^
../src/Render3D.cpp: In function 'void Render(sParamRender, cImage*, GtkWidget*)':
../src/Render3D.cpp:846:17: warning: 'GThread* g_thread_create(GThreadFunc, gpointer, gboolean, GError**)' is deprecated (declared at C:/MinGW/msys/1.0/opt/windows_32/include/glib-2.0/glib/deprecated/gthread.h:100): Use 'g_thread_new' instead [-Wdeprecated-declarations]
     Thread[i] = g_thread_create((GThreadFunc) MainThread, &thread_param[i], TRUE, &err[i]);
                 ^
../src/Render3D.cpp:846:90: warning: 'GThread* g_thread_create(GThreadFunc, gpointer, gboolean, GError**)' is deprecated (declared at C:/MinGW/msys/1.0/opt/windows_32/include/glib-2.0/glib/deprecated/gthread.h:100): Use 'g_thread_new' instead [-Wdeprecated-declarations]
     Thread[i] = g_thread_create((GThreadFunc) MainThread, &thread_param[i], TRUE, &err[i]);
                                                                                          ^
../src/Render3D.cpp: In function 'int main(int, char**)':
../src/Render3D.cpp:1564:3: warning: 'void g_thread_init(gpointer)' is deprecated (declared at C:/MinGW/msys/1.0/opt/windows_32/include/glib-2.0/glib/deprecated/gthread.h:260) [-Wdeprecated-declarations]
   g_thread_init(NULL);
   ^
../src/Render3D.cpp:1564:21: warning: 'void g_thread_init(gpointer)' is deprecated (declared at C:/MinGW/msys/1.0/opt/windows_32/include/glib-2.0/glib/deprecated/gthread.h:260) [-Wdeprecated-declarations]
   g_thread_init(NULL);
                     ^
../src/Render3D.cpp:1743:5: warning: 'void g_type_init()' is deprecated (declared at C:/MinGW/msys/1.0/opt/windows_32/include/glib-2.0/gobject/gtype.h:669) [-Wdeprecated-declarations]
     g_type_init();
     ^
../src/Render3D.cpp:1743:17: warning: 'void g_type_init()' is deprecated (declared at C:/MinGW/msys/1.0/opt/windows_32/include/glib-2.0/gobject/gtype.h:669) [-Wdeprecated-declarations]
     g_type_init();
                 ^
make: *** [src/Render3D.o] Error 1

So what is the problem here? Am I (still?) using the wrong compiler? Or is it just a matter of compiler settings? It seems some rather basic stuff like includes for windows and data types are mismatched.
« Last Edit: April 12, 2014, 01:54:41 PM by rh73 » Logged
quaz0r
Fractal Molossus
**
Posts: 652



« Reply #2 on: April 12, 2014, 04:20:46 AM »

i build 64bit mandelbulber in a mingw64 crossbuild environment that i compiled on my linux system. im not sure of any specific packages or steps for doing it in windows. also there is one change to the mandelbulber code that you need to get it to build under mingw64 which is different from mingw32 so i just change it manually when i make a win64 build. in src/netrender.hpp, i change

    #include <ws2tcpip.h>
    #include <winsock2.h>

to

    #include <stdint.h>
    #include <ws2tcpip.h>

to get it to build. also you need to build with -DWIN32. you will also need a custom objects.mk with all the windows libs and such. in any case creating a proper mingw environment is a rather lengthy process, there is usually not one package you can download somewhere that magically has all the libs and things you will need to build any particular program, so this is probably a lot more work than you were expecting.
« Last Edit: April 12, 2014, 04:32:17 AM by quaz0r » Logged
rh73
Forums Freshman
**
Posts: 10


« Reply #3 on: April 12, 2014, 05:02:50 AM »

Oh, I wasn't aware that you didn't actually build mandelbulber on Windows. And I don't feel like installing Linux just for this. But it shouldn't be too hard to do it on Windows if it's already possible to build the exe and compiler errors show that either I am doing something wrong (try to link wrong version of libs, for example) or that the code needs some more switches to truly build under Windows. I saw the -DWIN32 and was trying to build the version you linked in the other thread (1.17 think) because I thought the makefiles in there are already setup for windows. But so far without success.

As for setting up a development environment, I'm not afraid of spending some time there. Just that I don't really know where to continue after installing mingw and gtk+ and this packacke from win-builds seems to be a fully preconfigured environment for various languages including all sorts of libraries. I'm not sure about the OpenCL stuff though; I have downloaded the SDK from AMD, and it comes with the header files and the dll. Is it enough to make sure the headers are found and then manually copy the dll into the project? Oh well, I need to get it compiled first smiley
Logged
quaz0r
Fractal Molossus
**
Posts: 652



« Reply #4 on: April 12, 2014, 06:51:45 AM »

ah right if you are looking at the initial thing i uploaded you should be able to use the makefiles from that with the latest version. also you dont need any opencl stuff to build the opencl version for windows, theres something included in the mandelbulber source for that. looking at your errors again, im seeing that its because of the missing stdint.h include in netrender.hpp like i mentioned in my previous post.
« Last Edit: April 12, 2014, 06:54:55 AM by quaz0r » Logged
rh73
Forums Freshman
**
Posts: 10


« Reply #5 on: April 12, 2014, 01:53:58 PM »

After adding #include <stdint.h> to netrender.cpp and -DCL_USE_DEPRECATED_OPENCL_1_1_APIS as compiler flag (as suggested by quaz0r in another thread, I could post my clinfo if that's interesting)
I managed to compile a little bit so I think I'm on the right track, but stumbled on the next problem:

Code:
Building file: ../src/callbacks.cpp
Invoking: GCC C++ Compiler
g++ -static -DCL_USE_DEPRECATED_OPENCL_1_1_APIS -O3 -ffast-math -Wall -c -fmessage-length=0 -DWIN32 `pkg-config --cflags gtk+-2.0 gthread-2.0;` -MMD -MP -MF"src/callbacks.d" -MT"src/callbacks.d"   -o"src/callbacks.o" "../src/callbacks.cpp"
In file included from c:\mingw\msys\1.0\opt\windows_32\i686-w64-mingw32\include\winnt.h:134:0,
                 from c:\mingw\msys\1.0\opt\windows_32\i686-w64-mingw32\include\minwindef.h:146,
                 from c:\mingw\msys\1.0\opt\windows_32\i686-w64-mingw32\include\windef.h:8,
                 from c:\mingw\msys\1.0\opt\windows_32\i686-w64-mingw32\include\windows.h:69,
                 from c:\mingw\msys\1.0\opt\windows_32\i686-w64-mingw32\include\winsock2.h:23,
                 from c:\mingw\msys\1.0\opt\windows_32\i686-w64-mingw32\include\ws2tcpip.h:11,
                 from ../src/netrender.hpp:23,
                 from ../src/callbacks.cpp:30:
c:\mingw\msys\1.0\opt\windows_32\i686-w64-mingw32\include\basetsd.h:31:22: error: conflicting declaration 'typedef int INT32'
   typedef signed int INT32,*PINT32;
                      ^
In file included from C:/MinGW/msys/1.0/opt/windows_32/include/jpeglib.h:27:0,
                 from ../src/files.h:19,
                 from ../src/callbacks.cpp:26:
C:/MinGW/msys/1.0/opt/windows_32/include/jmorecfg.h:165:14: error: 'INT32' has a previous declaration as 'typedef long int INT32'
 typedef long INT32;
              ^
In file included from c:\mingw\msys\1.0\opt\windows_32\i686-w64-mingw32\include\wtypes.h:8:0,
                 from c:\mingw\msys\1.0\opt\windows_32\i686-w64-mingw32\include\winscard.h:10,
                 from c:\mingw\msys\1.0\opt\windows_32\i686-w64-mingw32\include\windows.h:97,
                 from c:\mingw\msys\1.0\opt\windows_32\i686-w64-mingw32\include\winsock2.h:23,
                 from c:\mingw\msys\1.0\opt\windows_32\i686-w64-mingw32\include\ws2tcpip.h:11,
                 from ../src/netrender.hpp:23,
                 from ../src/callbacks.cpp:30:
c:\mingw\msys\1.0\opt\windows_32\i686-w64-mingw32\include\rpcndr.h:65:25: error: conflicting declaration 'typedef unsigned char boolean'
   typedef unsigned char boolean;
                         ^
In file included from C:/MinGW/msys/1.0/opt/windows_32/include/jpeglib.h:27:0,
                 from ../src/files.h:19,
                 from ../src/callbacks.cpp:26:
C:/MinGW/msys/1.0/opt/windows_32/include/jmorecfg.h:236:13: error: 'boolean' has a previous declaration as 'typedef int boolean'
 typedef int boolean;
             ^
In file included from c:\mingw\msys\1.0\opt\windows_32\i686-w64-mingw32\include\combaseapi.h:153:0,
                 from c:\mingw\msys\1.0\opt\windows_32\i686-w64-mingw32\include\objbase.h:14,
                 from c:\mingw\msys\1.0\opt\windows_32\i686-w64-mingw32\include\ole2.h:17,
                 from c:\mingw\msys\1.0\opt\windows_32\i686-w64-mingw32\include\wtypes.h:12,
                 from c:\mingw\msys\1.0\opt\windows_32\i686-w64-mingw32\include\winscard.h:10,
                 from c:\mingw\msys\1.0\opt\windows_32\i686-w64-mingw32\include\windows.h:97,
                 from c:\mingw\msys\1.0\opt\windows_32\i686-w64-mingw32\include\winsock2.h:23,
                 from c:\mingw\msys\1.0\opt\windows_32\i686-w64-mingw32\include\ws2tcpip.h:11,
                 from ../src/netrender.hpp:23,
                 from ../src/callbacks.cpp:30:
c:\mingw\msys\1.0\opt\windows_32\i686-w64-mingw32\include\wtypesbase.h:376:17: error: conflicting declaration 'typedef boolean BOOLEAN'
 typedef boolean BOOLEAN;
                 ^
In file included from c:\mingw\msys\1.0\opt\windows_32\i686-w64-mingw32\include\minwindef.h:146:0,
                 from c:\mingw\msys\1.0\opt\windows_32\i686-w64-mingw32\include\windef.h:8,
                 from c:\mingw\msys\1.0\opt\windows_32\i686-w64-mingw32\include\windows.h:69,
                 from c:\mingw\msys\1.0\opt\windows_32\i686-w64-mingw32\include\winsock2.h:23,
                 from c:\mingw\msys\1.0\opt\windows_32\i686-w64-mingw32\include\ws2tcpip.h:11,
                 from ../src/netrender.hpp:23,
                 from ../src/callbacks.cpp:30:
c:\mingw\msys\1.0\opt\windows_32\i686-w64-mingw32\include\winnt.h:572:16: error: 'BOOLEAN' has a previous declaration as 'typedef BYTE BOOLEAN'
   typedef BYTE BOOLEAN;
                ^
../src/callbacks.cpp: In function 'gboolean motion_notify_event(GtkWidget*, GdkEventMotion*)':
../src/callbacks.cpp:72:24: warning: unused variable 'perspectiveType' [-Wunused-variable]
    enumPerspectiveType perspectiveType = (enumPerspectiveType) gtk_combo_box_get_active(GTK_COMBO_BOX(Interface.comboPerspectiveType));
                        ^
../src/callbacks.cpp:73:11: warning: unused variable 'zoom' [-Wunused-variable]
    double zoom = atofData(gtk_entry_get_text(GTK_ENTRY(Interface.edit_zoom)));
           ^
../src/callbacks.cpp:86:11: warning: unused variable 'closeUpRatio' [-Wunused-variable]
    double closeUpRatio = atof(gtk_entry_get_text(GTK_ENTRY(Interface.edit_mouse_click_distance)));
           ^
../src/callbacks.cpp:109:11: warning: unused variable 'boxWidth2' [-Wunused-variable]
    double boxWidth2 = boxWidth * z * persp;
           ^
../src/callbacks.cpp:110:11: warning: unused variable 'boxHeigth2' [-Wunused-variable]
    double boxHeigth2 = boxHeight * z * persp;
           ^
../src/callbacks.cpp: In function 'gboolean pressed_button_on_palette(GtkWidget*, GdkEventButton*)':
../src/callbacks.cpp:549:6: warning: unused variable 'y' [-Wunused-variable]
  int y = event->y;
      ^
make: *** [src/callbacks.o] Error 1

Is this an indication I'm using a wrong version of the jpeg lib?
« Last Edit: April 12, 2014, 01:57:54 PM by rh73 » Logged
Pages: [1]   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Mandelbulber 1.05 - with Windows installer Releases Buddhi 3 5108 Last post July 11, 2011, 10:20:49 PM
by taurus
Mandelbulber 1.061 - for Windows 64-bit Releases « 1 2 » Buddhi 16 10412 Last post August 10, 2011, 12:33:35 AM
by ihcn
Mandelbulber 1.13-1 - NetRender also for Windows Releases « 1 2 » Buddhi 17 21369 Last post April 24, 2013, 07:59:41 PM
by Buddhi
Building Mandelbulber on Windows with Visual Studio Mandelbulber neosettler 7 5861 Last post May 12, 2013, 01:17:10 AM
by JohnVV
Mandelbulber on Windows 8 Bug Reporting Mihaly 4 3774 Last post July 25, 2014, 03:35:28 PM
by ellarien

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.166 seconds with 25 queries. (Pretty URLs adds 0.011s, 2q)