Thread: Problem with separate compilation

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    The Earth is not flat. Clyde's Avatar
    Join Date
    Mar 2002
    Posts
    1,403

    Problem with separate compilation

    Right well I decided to make one of the DOS programs i had written into a fully fledged Win32 app.

    Since windows code is large enough and the actual program code is pretty big i thought it wise to separate the actual program code and place it in another file.

    Thing is i can't get it to compile.

    I placed the function prototypes (with their relevant includes) in a header file, along with a structure definition, I put the code for the various functions (and their releveant includes) into a .cpp file of the same name. Then I included the header file (with "") in my main source file.......

    well i get a wacky error:

    Link Error : Undefined symbol: ?string_analyse@@YA?AUanalysis@@V?$basic_string@DU ?$char_traits@D@std@@V?$allocator@D@2@@std@@0@Z (struct analysis string_analyse(class std::basic_string<char, struct std::char_traits<char>, class std::allocator<char>>, class std::basic_string<char, struct std::char_traits<char>, class std::allocator<char>>)) in
    HelloWin32temp.cp

    I must be doing something wrong here, but i can't figure out what, if I copy the source code directly into the main file and replace the include for my header file with the includes needed for the functions, then it works.

    Any ideas?
    Last edited by Clyde; 05-17-2002 at 12:36 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. searching problem
    By DaMenge in forum C Programming
    Replies: 9
    Last Post: 09-12-2005, 01:04 AM
  2. Compilation problem
    By OSDever in forum C++ Programming
    Replies: 10
    Last Post: 09-08-2005, 06:42 AM
  3. half ADT (nested struct) problem...
    By CyC|OpS in forum C Programming
    Replies: 1
    Last Post: 10-26-2002, 08:37 AM
  4. binary tree problem - help needed
    By sanju in forum C Programming
    Replies: 4
    Last Post: 10-16-2002, 05:18 AM