Problem while including files

Sysprogs forums Forums VisualGDB Problem while including files

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #9186
    akhilavit
    Participant

    Im trying to cross compile windows project on linux.

     

    I have a romote directory folder in my AppData of windows it contains folders 000,001,002……

     

    I have a Linux App project LinuxApp and it uses a function from MySharedLib.so 

    (This is just an example, although my project has a little complicated structure.)

    Folder Structure:

    Project->LinuxApp->LinuxApp->main.cpp

    Project->MySharedLib->API->MySharedLib.cpp

    I have added include directory of API folder to LinuxApp project properties, dependdency is also set.

    When I include MySharedLib.cpp, it works, but while debugging, it takes me to MySharedLib.cpp in romote directory folder. This happens MySharedLib. 

    What should I do?

     

    Please explain in details.

    Thanks

    #9187
    akhilavit
    Participant

    This issue is resolved when I added

    #include “../../MySharedLib/API/MySharedLib.cpp”

     

    i.e. when I give relative path, it works smoothly.

     

    I dont want to give path this way. Please guide me.

     

    Note:

    When I type #include “../../ 

    following folders are shown up:

    MySharedLib, LinuxApp, 000, 001, 002

    all of the above folders are at the same level .. is that little weird?

    Because my project folder contains only two folders viz. MySharedLib & LinuxApp

     

    and 000, 001, 002 ….these are not present there

    #9195
    support
    Keymaster

    Hi,

    Most likely this happens because your LinuxApp project specifies the absolute path to MySharedLib in its settings. This is by design – absolute include paths are treated as system paths and are automatically cached.

    You can override this by adding a custom path mapping in LinuxApp’s VisualGDB Project Properties or by using relative paths in project properties instead.

    Please also note that including the library .cpp files from other .cpp files will not refer to the code in the library, but will instead just copy that code to your application. You can read more about C++ headers and sources here: http://www.cplusplus.com/forum/articles/10627/

    #9196
    akhilavit
    Participant

    Sorry. I meant #include “../../MySharedLib/API/MySharedLib.h” and not .cpp 

    This is my API class

    Thanks

    #9199
    support
    Keymaster

    No problem. Please follow the instructions from the rest of the post in order to resolve this.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.