Note that there are some explanatory texts on larger screens.

plurals
  1. POCompiling Mongoose's hello.c under Windows
    primarykey
    data
    text
    <p>I am trying to compile the included <a href="https://github.com/valenok/mongoose/blob/master/examples/hello.c" rel="nofollow">hello.c</a> example from <a href="https://code.google.com/p/mongoose/" rel="nofollow">Mongoose</a> under Windows. I am using the Microsoft Visual command prompt and I have copied the mongoose.c and mongoose.h to the same directory as the hello.c example.</p> <p>When I write "cl hello.c" I get the following output/error:</p> <pre><code>Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01 for 80x86 Copyright (C) Microsoft Corporation. All rights reserved. hello.c Microsoft (R) Incremental Linker Version 10.00.30319.01 Copyright (C) Microsoft Corporation. All rights reserved. /out:hello.exe hello.obj hello.obj : error LNK2019: unresolved external symbol _mg_stop referenced in function _main hello.obj : error LNK2019: unresolved external symbol _mg_start referenced in function _main hello.obj : error LNK2019: unresolved external symbol _mg_printf referenced in function _begin_request_handler hello.obj : error LNK2019: unresolved external symbol _snprintf referenced in function _begin_request_handler hello.obj : error LNK2019: unresolved external symbol _mg_get_request_info referenced in function _begin_request_handler hello.exe : fatal error LNK1120: 5 unresolved externals </code></pre> <p>There is a <a href="https://github.com/valenok/mongoose/blob/master/examples/Makefile" rel="nofollow">Makefile</a> included with the examples and I have tried to use the Makefile to do the build, but do not understand how to do this. If i try "nmake hello.exe". I get the following output/error:</p> <pre><code>Microsoft (R) Program Maintenance Utility Version 10.00.30319.01 Copyright (C) Microsoft Corporation. All rights reserved. cl -W -Wall -I.. -pthread -g hello.c Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01 for 80x86 Copyright (C) Microsoft Corporation. All rights reserved. cl : Command line error D8004 : '/W' requires an argument NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.EXE"' : return code '0x2' Stop. </code></pre> <p><strong>EDIT</strong> I have also tried the to compile like instructed in the <a href="https://github.com/valenok/mongoose/blob/master/UserManual.md#embedding" rel="nofollow">user manual</a> which on windows should translate to "cl hello.c mongoose.c -o hello.exe" but then I get the following error message:</p> <pre><code>Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01 for 80x86 Copyright (C) Microsoft Corporation. All rights reserved. cl : Command line warning D9035 : option 'o' has been deprecated and will be removed in a future release hello.c mongoose.c Generating Code... Microsoft (R) Incremental Linker Version 10.00.30319.01 Copyright (C) Microsoft Corporation. All rights reserved. /out:hello.exe /out:hello.exe hello.obj mongoose.obj hello.obj : error LNK2019: unresolved external symbol _snprintf referenced in function _begin_request_handler hello.exe : fatal error LNK1120: 1 unresolved externals </code></pre> <p>Does anyone have suggestions on what steps needs to be taken in order to compile the hello.c example for Mongoose under Windows? </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload