Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8794865
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:18:33+00:00 2026-06-13T23:18:33+00:00

I two modules in same src folder. mod1 declares function I wish to use

  • 0

I two modules in same src folder. mod1 declares function I wish to use in module mod2:

-module(mod1).
-export([myfunc/1]).

myfunc(A) -> {ok}.

In other module I not import mod1:

-module(mod2).

If I do “mod1:” in mod2 it recognizes “myfunc”, problem is at run-time when I call mod1:myfunc(A) I get “undefined function mod1:myfunc/1”

I not understand why I get error if intellisense detect my mod1 function in mod2?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T23:18:34+00:00Added an answer on June 13, 2026 at 11:18 pm

    From the shell, you could try doing mod1:module_info(exports) to see the list of all the exported functions, though if your module is written as it is above, it should be generating a syntax error.

    If, however, I’m wrong, and you actually do have it written properly in your module, (ie, it’s just a typo here), try doing the following at the erlang shell:

    c(mod1).
    c(mod2).
    

    And see if that works for you. This will compile and load the modules for you. If you don’t have the module compiled (ie, it’s just a .erl file in the directory), that’s insufficient.

    EDIT

    Also, make sure that the beam files are being loaded properly when erlang launches. This is typically done by launching erl with erl -pa /path/to/beams

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I got two modules (compile units), both using a module variable with the same
In my code base I find that two modules have structures with the same
I have two modules with the same method name. When I include both modules
If two modules implement the same hook in Drupal, does the system have a
When my system requires two classes or modules of the same name, what can
I've got a name clash between two different Haskell modules that want to use
https://github.com/caolan/async https://github.com/maxtaco/tamejs These are two modules. To me, it seems like the same thing,
Is it possible to create two modules which extend the same core model like
What's the best way to install two python modules with the same name? I
say I have two 'modules'. For instance the hardware-interface layer of a RS-232 port

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.