Skip to content

Include path #32

@mottosso

Description

@mottosso

Hello!

I managed to get the example project in #30 running, after having fought with #31, but then ran into one more issue with the include path not seeming to be taken into account by blink.

Original Program

From #30.

#include <iostream>
#include <windows.h>

void changefunction() {
    static int n = 6;
    // n = 0;
    std::cout << n++ << std::endl;
}


int main(int argc, char** argv) {

    while (true)
    {
        changefunction();
        Sleep(1000);
    }

    return 0;

This builds fine, and changing anything in changefunction works well. But now look here.

Changed program

#include <iostream>
#include <windows.h>
#include "cannot_be_found.h"

void changefunction() {
...

The problem

There are two of them; one making the other harder to spot.

  1. blink does not report the error
  2. The error being that "cannot_be_found.h".. cannot be found

The error message is sporadic however, I suspect some issue with STDOUT and buffering. Here's what I typically see.

Detected modification to: C:\Users\marcus\source\repos\ConsoleApplication1\ConsoleApplication1.cpp
ConsoleApplication1.cpp

Finished compiling "C:\Users\marcus\source\repos\ConsoleApplication1\ConsoleApplication1.temp.obj" with code 2.

That empty space there appears related to whether or not there's an error. When compilation succeeds, the empty line is replaced with..

Successfully linked object file into executable image.

The workaround

I found that if I replicate my include path in the environment where blink is called, things appear to work.

$ set INCLUDE=all;the;things;VS;included
$ blink.exe consoleapplication1.exe
win!

Is there another way to cope with this? I couldn't find mention of this anywhere, but I don't see how blink could be used without it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions