nOlander

Forum Replies Created

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts

  • nOlander
    Participant

    Just realized I never responded to this, but this resolved the issue and it has been building properly


    nOlander
    Participant

    I was able to create a new project from the CMake file successfully, it appears this was occurring when attempting to add a new VisualGDB CMake project to an existing solution. Still remains a bug, but it’s less of an issue as I am able to create a new project from a CMake file and add other projects to the created solution.


    nOlander
    Participant

    I believe I may have resolved this. In this section:

    I switched the sysroot line to the PUBLIC section and it seemed to work.

    I’m not 100% certain, but it is no longer reporting the snap7.h not found on building. I will complete some testing and report the success here.


    nOlander
    Participant

    My apologies for the delay in response. I believe I resolved that and got this output:

    Does that clarify the issue at all? It seems a bit more verbose than the previous one.


    nOlander
    Participant

    When I output the value of ${CMAKE_SYSROOT} it is printing the correct path to the sysroot but I’m still getting that same error when I build. This seems to be the affected due to you

    which outputs

     

    My make output is the following:

    Does this help you in resolving the issue all?

    • This reply was modified 1 month, 1 week ago by  nOlander.

    nOlander
    Participant

    I made that change in my CMake file, but it’s still reporting No such file or directory even after changing the CMakeLists.txt and clean/rebuild the entire solution. Is there any way to view the output of CMake generating the make command? I can only find the output for the build, not including CMake.


    nOlander
    Participant

    This is how the CMake file is set up:

    The directory with the header file that’s not being found is  C:/SysGCC/raspberry/arm-linux-gnueabihf/sysroot/usr/local/include and it gets added to the CMakeLists.txt via this line: target_include_directories(Snap7-Wrapper PRIVATE ../../=/usr/local/include). I did notice that it was being inserted above the already existing target_include_directories for that target, so I tried manually editing it in to the existing one but it didn’t make a difference.

    You mentioned making sure to utilize ${CMAKE_SYSROOT}/path/to/include format, but I noticed that the line inserted automatically didn’t do that and instead used ../../=/usr/local/include.

    Do those help at all?

    I also checked the VS Properties for the project and under Type it says “CMake Project”. Is this a regular CMake Project like you said and if so, how can I change it to and Advanced CMake Project?


    nOlander
    Participant

    I’m fairly certain I have it configured as an Advanced CMake project, but how would I tell?

    I’ve tried to use the automatic header discovery and I’ll get the notification about “Found one additional include directory required by the current file”, which edits the appropriate CMake file, but it only seems to resolve the autocomplete/red squiggles error and I still get the compilation error.

    If possible, I would prefer to leave the CMake files untouched as much as possible because I know they work with the directory structure on the Linux system, but I will make changes if needed. When you say “VS properties for that target”, what do you mean? I’ve selected the specific .a item in the solution explorer and added the sysroot/usr/local/include directory to the include directories list, but it hasn’t made a change in the build.

     

    Attachments:
    You must be logged in to view attached files.
Viewing 8 posts - 1 through 8 (of 8 total)