Thread: include Problem

  1. #1
    Registered User
    Join Date
    Sep 2004
    Posts
    1

    include Problem

    I have the following problem that i have never seen before.

    I have the following program queue_c.c,
    Code:
    #include "JMS/C_API/stlport/stdlib.h"
    #include "JMS/C_API/stlport/stdio.h"
    #include "JMS/C_API/stlport/string.h"
    
    void main(int argc, char *argv[]) {
      receiver();
    }
    
    void receiver(){
       ConnectionSetClientID(pQueueConnection, (char*)"RECEIVER", &iErr, szErrBuf);
    }
    
    And the mscapi.h has struct and function definitions,
    
    STC_JMS_CAPI  void ConnectionSetClientID(SBYN_Connection *, char *, int *, char *);
    
    When i compile I get the following error
    
    Undefined                       first referenced
     symbol                             in file
    ConnectionSetClientID               queue_c.o
    QueueReceiverClose                  queue_c.o
    I thought maybe the include wasn't working properly, so i put the function definitions in the c but i got the same errors. I have never seen this before and find this quite wierd.

    Any help would be good.
    Last edited by Salem; 09-24-2004 at 11:55 AM. Reason: CODE TAGS!!! - Read the "read before posting" posts

  2. #2
    Gawking at stupidity
    Join Date
    Jul 2004
    Location
    Oregon, USA
    Posts
    3,218
    You need to link the .c file where those functions actually reside in with your program's .c file to make the final executable. Function prototypes alone aren't enough to actually perform the function.
    If you understand what you're doing, you're not learning anything.

  3. #3
    ---
    Join Date
    May 2004
    Posts
    1,379
    header files contain the declarations
    source files contain the definitions

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem with simple socket client/server program
    By spencer88 in forum C Programming
    Replies: 6
    Last Post: 05-05-2009, 11:05 PM
  2. debug assertion failed!
    By chintugavali in forum C Programming
    Replies: 4
    Last Post: 12-11-2007, 06:23 AM
  3. include problem
    By Strait in forum C++ Programming
    Replies: 4
    Last Post: 01-31-2005, 04:01 PM
  4. Read and write hanging
    By zee in forum C Programming
    Replies: 8
    Last Post: 08-03-2004, 11:19 PM
  5. help with finding lowest number entered
    By volk in forum C++ Programming
    Replies: 12
    Last Post: 03-22-2003, 01:21 PM