Giter VIP home page Giter VIP logo

Comments (18)

nmdguerreiro avatar nmdguerreiro commented on July 24, 2024

It looks like the hello world source set doesn't include opt.c. I don't
have access to any Windows machines to confirm though.
On Mon, 14 Dec 2015 at 20:59, Mike Parsons [email protected] wrote:

"C:\Haywire\haywiresln" (default target) (1) ->
"C:\Haywire\haywire_hello_worldvcxprojmetaproj" (default target) (4) ->
"C:\Haywire\haywire_hello_worldvcxproj" (default target) (7) ->
(Link target) ->
programobj : error LNK2019: unresolved external symbol opt_config_init
refer
enced in function main [C:\Haywire\haywire_hello_worldvcxproj]
programobj : error LNK2019: unresolved external symbol opt_config_free
refer
enced in function main [C:\Haywire\haywire_hello_worldvcxproj]
programobj : error LNK2019: unresolved external symbol opt_args_free
referen
ced in function main [C:\Haywire\haywire_hello_worldvcxproj]
programobj : error LNK2019: unresolved external symbol opt_config_parse
refe
renced in function main [C:\Haywire\haywire_hello_worldvcxproj]
programobj : error LNK2019: unresolved external symbol opt_flag_bool
referen
ced in function main [C:\Haywire\haywire_hello_worldvcxproj]
programobj : error LNK2019: unresolved external symbol opt_flag_int
referenc
ed in function main [C:\Haywire\haywire_hello_worldvcxproj]
programobj : error LNK2019: unresolved external symbol opt_flag_string
refer
enced in function main [C:\Haywire\haywire_hello_worldvcxproj]
C:\Haywire\builds\windows\debug\haywire_hello_world\haywire_hello_worldexe
:
fatal error LNK1120: 7 unresolved externals
[C:\Haywire\haywire_hello_worldvc
xproj]

134 Warning(s)
8 Error(s)


Reply to this email directly or view it on GitHub
#76.

from haywire.

mikeptweet avatar mikeptweet commented on July 24, 2024

I got it compiled by including opt.c in the visual studio project, however when I run the program and fire off a request, it immediately exits. See the attached gif.

haywire

from haywire.

nmdguerreiro avatar nmdguerreiro commented on July 24, 2024

If you compile in debug mode, do you get an error message when you run it?

from haywire.

mikeptweet avatar mikeptweet commented on July 24, 2024

Nope ... nothing. The same thing happens if I try to connect via the
browser. The server ends immediately.

On Wed, Dec 16, 2015 at 4:43 AM, Nuno Guerreiro [email protected]
wrote:

If you compile in debug mode, do you get an error message when you run it?


Reply to this email directly or view it on GitHub
#76 (comment).

from haywire.

nmdguerreiro avatar nmdguerreiro commented on July 24, 2024

I wonder what
https://github.com/kellabyte/Haywire/blob/master/src/haywire/http_server.c#L203
is
actually returning in that case. Could you print the result of that call?

On Wed, Dec 16, 2015 at 10:18 AM Mike Parsons [email protected]
wrote:

Nope ... nothing. The same thing happens if I try to connect via the
browser. The server ends immediately.

On Wed, Dec 16, 2015 at 4:43 AM, Nuno Guerreiro [email protected]
wrote:

If you compile in debug mode, do you get an error message when you run
it?


Reply to this email directly or view it on GitHub
#76 (comment).


Reply to this email directly or view it on GitHub
#76 (comment).

from haywire.

mikeptweet avatar mikeptweet commented on July 24, 2024

I set up the debugger in Visual Studio and it breaks here (strlen.asm)

[image: Inline image 1]

On Wed, Dec 16, 2015 at 5:25 AM, Nuno Guerreiro [email protected]
wrote:

I wonder what

https://github.com/kellabyte/Haywire/blob/master/src/haywire/http_server.c#L203
is
actually returning in that case. Could you print the result of that call?

On Wed, Dec 16, 2015 at 10:18 AM Mike Parsons [email protected]
wrote:

Nope ... nothing. The same thing happens if I try to connect via the
browser. The server ends immediately.

On Wed, Dec 16, 2015 at 4:43 AM, Nuno Guerreiro <
[email protected]>
wrote:

If you compile in debug mode, do you get an error message when you run
it?


Reply to this email directly or view it on GitHub
<#76 (comment)
.


Reply to this email directly or view it on GitHub
#76 (comment).


Reply to this email directly or view it on GitHub
#76 (comment).

from haywire.

mikeptweet avatar mikeptweet commented on July 24, 2024

Here is where the error occurs ... getting the strlen(current_time)

[image: Inline image 1]

On Wed, Dec 16, 2015 at 5:38 AM, Mike Parsons [email protected]
wrote:

I set up the debugger in Visual Studio and it breaks here (strlen.asm)

[image: Inline image 1]

On Wed, Dec 16, 2015 at 5:25 AM, Nuno Guerreiro [email protected]
wrote:

I wonder what

https://github.com/kellabyte/Haywire/blob/master/src/haywire/http_server.c#L203
is
actually returning in that case. Could you print the result of that call?

On Wed, Dec 16, 2015 at 10:18 AM Mike Parsons [email protected]
wrote:

Nope ... nothing. The same thing happens if I try to connect via the
browser. The server ends immediately.

On Wed, Dec 16, 2015 at 4:43 AM, Nuno Guerreiro <
[email protected]>
wrote:

If you compile in debug mode, do you get an error message when you run
it?


Reply to this email directly or view it on GitHub
<
https://github.com/kellabyte/Haywire/issues/76#issuecomment-165049690>.


Reply to this email directly or view it on GitHub
<#76 (comment)
.


Reply to this email directly or view it on GitHub
#76 (comment).

from haywire.

mikeptweet avatar mikeptweet commented on July 24, 2024

Sorry ... here's the screenshot

error

from haywire.

nmdguerreiro avatar nmdguerreiro commented on July 24, 2024

Humm, that's weird. I just checked the documentation on MSDN and ctime is supposed to return a null terminated string, so strlen shouldn't have an issue.

Note that current_datetime.length is initialized until the next line runs. Does strlen cause a segmentation fault or does it return?

from haywire.

mikeptweet avatar mikeptweet commented on July 24, 2024

It causes a segmentation fault and the program exits

On Wed, Dec 16, 2015 at 6:43 AM, Nuno Guerreiro [email protected]
wrote:

Humm, that's weird. I just checked the [image: documentation on MSDN]
https://camo.githubusercontent.com/0fa69a427078eefe730a0aedb180c20a47237e62/68747470733a2f2f6d73646e2e6d6963726f736f66742e636f6d2f656e2d75732f6c6962726172792f35397735786364792e61737078
and ctime is supposed to return a null terminated string, so strlen
shouldn't have an issue.

Note that current_datetime.length is initialized until the next line
runs. Does strlen cause a segmentation fault or does it return?


Reply to this email directly or view it on GitHub
#76 (comment).

from haywire.

nmdguerreiro avatar nmdguerreiro commented on July 24, 2024

And what's the value of current_time btw? I wonder if that is returning NULL.

from haywire.

mikeptweet avatar mikeptweet commented on July 24, 2024

Error Reading Character Of Strings
Unable to read memory

On Wed, Dec 16, 2015 at 9:32 AM, Nuno Guerreiro [email protected]
wrote:

And what's the value of current_time btw?


Reply to this email directly or view it on GitHub
#76 (comment).

from haywire.

mikeptweet avatar mikeptweet commented on July 24, 2024

If you need a Windows Environment to test on ... just load up this Hands On Lab from Microsoft and it gives you a full blown remote Windows - Visual Studio 2015 environment all avilable from a web browser

https://vlabs.holsystems.com/vlabs/technet?eng=VLabs&auth=none&src=vlabs&altadd=true&labid=21201&lod=true

from haywire.

nmdguerreiro avatar nmdguerreiro commented on July 24, 2024

Sweet!

from haywire.

nmdguerreiro avatar nmdguerreiro commented on July 24, 2024

@mikeptweet - I ran build.bat to generate the solution files and I didn't have to add any additional sources. After that I was able to reproduce the error. I fixed it by adding:

#include <time.h>

at the top of http_response_cache.c.

Can you try doing that and running again just to confirm?

from haywire.

nmdguerreiro avatar nmdguerreiro commented on July 24, 2024

Opened #77 to fix it. Without the header, the current time is returns as negative and that causes ctime to return an invalid string.

from haywire.

mikeptweet avatar mikeptweet commented on July 24, 2024

Bingo ... thanks a bunch :-)

from haywire.

nmdguerreiro avatar nmdguerreiro commented on July 24, 2024

Happy to help :-)
On Wed, 16 Dec 2015 at 18:03, Mike Parsons [email protected] wrote:

Bingo ... thanks a bunch :-)


Reply to this email directly or view it on GitHub
#76 (comment).

from haywire.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.