[Libwebsockets] [libwebsockets] compilation fails with TEST_SERVER_EXTPOLL (#77)

"Andy Green (林安廸)" andy at warmcat.com
Thu Feb 27 14:46:30 CET 2014


On 27/02/14 18:47, the mail apparently from Marjan Tomas included:
> when compiling the actual libwebsockets master branch with
> MinGW-w64 (gcc 4.8.2) & CMake 2.8.12.2 on Win7 and
> the cmakle command line parameter
>
>      -DLWS_WITHOUT_TEST_SERVER_EXTPOLL=1

I tried

cmake .. -DCMAKE_INSTALL_PREFIX:PATH=/usr 
-DLWS_WITHOUT_TEST_SERVER_EXTPOLL=1 -DLIB_SUFFIX=64

and this built OK

> is omitted and instead simply compiled via

To make sure it stuck I also did

diff --git a/test-server/test-server.c b/test-server/test-server.c
index 1e86146..865431b 100644
--- a/test-server/test-server.c
+++ b/test-server/test-server.c
@@ -212,6 +212,8 @@ static int callback_http(struct libwebsocket_context 
*context,
         const char *mimetype;
  #ifdef EXTERNAL_POLL
         struct libwebsocket_pollargs *pa = (struct 
libwebsocket_pollargs *)in;
+#else
+x
  #endif

         switch (reason) {

and he blew up on compile, meaning we are building with extpoll disabled.

So it's only a problem with mingw or I missed the point?

-Andy


>      cmake -DLWS_WITH_SSL=0 -G "MinGW Makefiles" ..
>      mingw32-make.exe
>
> the compilation fails at the make step with the error:
>
>      Linking C executable bin\libwebsockets-test-server-extpoll.exe
>      lib\libwebsockets_static.a(libwebsockets.c.obj):
>              libwebsockets.c:(.text+0x0):
>                      multiple definition of `emulated_poll at 12'
>      CMakeFiles\test-server-extpoll.dir/objects.a(websock-w32.c.obj):
>              websock-w32.c:(.text+0x0):
>                      first defined here
>      lib\libwebsockets_static.a(libwebsockets.c.obj):
>              libwebsockets.c:(.bss+0x0):
>                      multiple definition of `poll'
>      CMakeFiles\test-server-extpoll.dir/objects.a(websock-w32.c.obj):
>              websock-w32.c:(.bss+0x0):
>                  first defined here
>      d:/mingw-w64/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/bin/ld.exe:
>              lib\libwebsockets_static.a(libwebsockets.c.obj):
>                  bad reloc address 0x0 in section `.data'
>      collect2.exe: error: ld returned 1 exit status
>      CMakeFiles\test-server-extpoll.dir\build.make:195:
>              recipe for target 'bin/libwebsockets-test-server-extpoll.exe' failed
>      mingw32-make.exe[2]: *** [bin/libwebsockets-test-server-extpoll.exe] Error 1
>      CMakeFiles\Makefile2:303:
>              recipe for target 'CMakeFiles/test-server-extpoll.dir/all' failed
>      mingw32-make.exe[1]: *** [CMakeFiles/test-server-extpoll.dir/all] Error 2
>      Makefile:135: recipe for target 'all' failed
>      mingw32-make.exe: *** [all] Error 2
>
>
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/warmcat/libwebsockets/issues/77
>




More information about the Libwebsockets mailing list