New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
>hrl files present in the include directory of project are not recognized in the src directory of the project #298
Comments
I imported the project, without building/compiling anything (can't on this machine). The only include files that couldn't be found are:
which don't exist and I assume are being generated by the build (for example the first one from asn1). If you look for those files and see what directories they are located in, then you can change the eclipse project's configuration (right-click->properties->Erlang) and add those directories to 'include'. Then it should work. Please note that parse transforms aren't handled and the errors related to that will remain. |
Maybe I should have asked first: how did you create the ejabberd project in eclipse? Is it configured properly (src and include directories)? |
Vlad Dumitrescu, first of all let me thank you a lot for replying to my problem.I am new to ejabberd and erlang and it has been very tough to get any reply.So thank you really.
I would like to tell you that I have solved the issue.The problem was that I was running my code on eclipse and in my project structure all my .hrl files were placed inside include directory.And in eclipse if this happens then you have to give the complete path with double slashes in it to be able to recognize the .hrl files. Or the second option is to place all the .hrl files in the src directory only right from the start itself.
Thank you anyway.
… On March 1, 2017 at 1:42 PM Vlad Dumitrescu ***@***.***> wrote:
Maybe I should have asked first: how did you create the ejabberd project in eclipse? Is it configured properly (src and include directories)?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub #298 (comment) , or mute the thread https://github.com/notifications/unsubscribe-auth/AY2xO6dzdFCPsTajOk2zDL2-UnEVFwaZks5rhSh7gaJpZM4MPUts .
|
It should have found the hrl files in include too. Is this your own project, or ejabberd? |
I first create an erlang project then I import the source code of ejabberd into it. |
Try this: Build first ejabberd from the command line. Then create a new project in Eclipse and in the "location" field enter the location of the ejabberd code. Then on the "project layout" page, press "discover paths". All directories including .erl or .hrl files will be added automatically. This should give you better configuration that hopefully finds all files. |
Actually, I am using windows platform so I had already built ejabberd using the windows installer.I didn't get the meaning of "location","project layout", and "discover paths" you mentioned. |
When creating a project, you get to set the name and there is a field for specifying the location. Uncheck the "use default" and browse to wherever the ejabberd code is. Then on the third page (the second image you attached) you have the project layout configuration. Since there is already code, the button "Discover paths..." should be enabled, press it to fill the paths automatically. |
Oh, I see. This is not how erlide works. You don't need to compile from the console, but erlide is doing it for you. If you set |
Do I see right that the Erlang file has no syntax highlighting? Then it's possible that there's something wrong with the communication with the backend. Anyway, did you build ejabberd before importing the project? The jid.hrl file, for example, is part of xmpp, which is fetched in ./deps when runing make. Then when creating the eclipse project and pressing "discover paths", you will get all dependencies. The full suport for rebar projects is in the works. There will probably still be errors, mostly because of the lager parse transform, which is not well supported by erlide. It doesn't know that it should compile the parse transform first. Usually, doing a clean and rebuild (from eclipse) might help. |
And you created the eclipse project after that, using the "discover paths" button? In the project properties you should see all the |
yes exactly, but still the problem continues. |
Very strange! It works for me... Do you have "Project->Build automatically" enabled? Did you try "Project->Clean"? Please go to Window->Preferences->Erlang->Report problems, create a report and send it to me (or attach it here). Maybe I can see something there. |
Yes my "Project->Build automatically" is enabled and I did use "Project->Clean" |
Please attach an problem report like described above. |
I was studying the source code of ejabberd on eclipse. i figured out that each of my .erl files present the src folder of the project with a include statement in it was showing an compilation error on saving the project.
When I searched for the errors it said that it was not able to include the .hrl files present in the include folder.
I wanted to know that why is this happening as the files placed in include directory must be recognized in the src folder of the same project.
i have also tried the solutions given on this link
http://www2.erlangcentral.org/wiki/?title=Compile_With_Hard_To_Find_Include_Files_In_Erlang_Shell
but this also didn't worked for me.
Anyone who has any Idea about the issue.
The text was updated successfully, but these errors were encountered: