Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How To Add New Code - NetBeans

How To Add New Code - NetBeans

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialhelpquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Django_Untaken
    wrote on last edited by
    #1

    Hello all... I have this C code which I can compile and modify using NetBeans. But problems come when I try to separate some of the code to new files (.h & .c). I get these Unresolved External Symbols xxxxx. Example

    /*newFile.h*/
    int add(int a, int b);

    /*newFile.c*/
    int add(int a, int b)
    { return a + b; }

    /*main.c*/
    #include "newFile.h"
    int main()
    {
    int result = add(5,6); // this is where I get said error
    _getch();
    return 0;
    }

    How do I overcome this error....thanks for anything you share.

    R L 2 Replies Last reply
    0
    • D Django_Untaken

      Hello all... I have this C code which I can compile and modify using NetBeans. But problems come when I try to separate some of the code to new files (.h & .c). I get these Unresolved External Symbols xxxxx. Example

      /*newFile.h*/
      int add(int a, int b);

      /*newFile.c*/
      int add(int a, int b)
      { return a + b; }

      /*main.c*/
      #include "newFile.h"
      int main()
      {
      int result = add(5,6); // this is where I get said error
      _getch();
      return 0;
      }

      How do I overcome this error....thanks for anything you share.

      R Offline
      R Offline
      Rick York
      wrote on last edited by
      #2

      You have to make sure that newfile.obj (or whatever it compiles to) is being linked during the build process.

      1 Reply Last reply
      0
      • D Django_Untaken

        Hello all... I have this C code which I can compile and modify using NetBeans. But problems come when I try to separate some of the code to new files (.h & .c). I get these Unresolved External Symbols xxxxx. Example

        /*newFile.h*/
        int add(int a, int b);

        /*newFile.c*/
        int add(int a, int b)
        { return a + b; }

        /*main.c*/
        #include "newFile.h"
        int main()
        {
        int result = add(5,6); // this is where I get said error
        _getch();
        return 0;
        }

        How do I overcome this error....thanks for anything you share.

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        Get yourself a copy of Visual Studio, it is much better for building C/C++/C# projects.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups