Menu

Source in multiple files

2002-10-21
2012-09-26
  • Nobody/Anonymous

    Hey all,

    I have a problem about spreading my code into several different files and then trying to compile.

    After prototyping some code in 1 file and successfully compiling and running it, I thought it was time to modularise and object orientate my work. However, Dev-c++ can't seem to find the other files.

    I have 3 files: 1 Map.h, 2 Map.cpp, 3 Main.cpp

    The Map* files make up a class that I use in Main. All files are in the same directory and added to the project. But when compiling,  it complains 'Map' undeclared (first use this function)

    Has anyone had this problem before?

    Thanks.

     
    • Nobody/Anonymous

      Actually, I just solved it.

      Don't know if it matters but:

      1. I created an empty project instead of the usual windows application
      2. I made my header file a .hpp file instead of .h

      As long as it works, I am happy!

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.