Toymods Car Club
www.toymods.org.au
F.A.Q. F.A.Q.    Register Register    Login Login    Home Home
Members Members    Search Search
Toymods » The Outhouse » anyone have much experience with c?

Show: Today's Posts  :: Show Polls 
Email to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
AuthorTopic
ehendrikd
Forums Junkie


Location:
ballarat
Registered:
April 2003
 
anyone have much experience with c? Fri, 11 June 2004 05:46 Go to next message
a call to comp nerds Evil or Very Mad

i have a function in one file (it has no header file) and another function in a different file that i want to call the first function.

i have tried making the second function extern but no luck, always getting an 'undeclared identifier' complier error.

i have mainly worked with c++, so lonely functions that are not attached to an object i am a little unfamilar with.

any help?

cheers
ehendrikd
  Send a private message to this user    
RWDboy
Forums Junkie


Location:
South Australia
Registered:
July 2002
Re: anyone have much experience with c? Fri, 11 June 2004 15:37 Go to previous messageGo to next message
Are you using a makefile or not?

Your best bet is to have somewhere in the file that calls the first function (function prototype) try a line like this ->

extern type nameoffunc(blah, blah, blah);

you should be able to use that function anywhere within that file.

then when you link the thing, make sure you have something like

gcc -c firstfile.c

gcc -c filethatcallsfirstfile.c

gcc -o firstfile.o filethatcallsfirstfile.o

geddit?
  Send a private message to this user    
Draza
Forums Junkie


Location:
Wahroonga
Registered:
June 2003
Re: anyone have much experience with c? Fri, 11 June 2004 22:35 Go to previous messageGo to next message
Bringing back bad memories...... no .......must get out of here.
  Send a private message to this user    
RWDboy
Forums Junkie


Location:
South Australia
Registered:
July 2002
Re: anyone have much experience with c? Sat, 12 June 2004 00:26 Go to previous messageGo to next message
lol - seriously what's wrong with C? Are you an 'object oriented' code-monkey or something Razz Or you just left the whole programming thing when you realised it was a totally frustrating exercise in human torture?
  Send a private message to this user    
ehendrikd
Forums Junkie


Location:
ballarat
Registered:
April 2003
 
Re: anyone have much experience with c? Mon, 14 June 2004 23:47 Go to previous messageGo to next message
thanks for the replies guys Very Happy

the situation is i am intergrating a f2c (fortran to c) generated c function into a vc++ 6.0 dll. i have everything compiling except that it cant find the c function that is in its own file. i have tried using a header file that contains the function prototype but no luck. i have made a test dll where the lone c function can be found, so i think the problem is perhaps in the order that it links.

joy joy joy Razz

cheers
  Send a private message to this user    
RWDboy
Forums Junkie


Location:
South Australia
Registered:
July 2002
Re: anyone have much experience with c? Tue, 15 June 2004 02:08 Go to previous messageGo to next message
Quote:

i have everything compiling except that it cant find the c function that is in its own file
That just sounds evil! If you put a prototype at the very top of the file (yeah most people use header files but you don't have to) then this shouldn't happen!
  Send a private message to this user    
Squid
Forums Junkie


Location:
Canberra
Registered:
August 2003
 
Re: anyone have much experience with c? Tue, 15 June 2004 02:27 Go to previous message
create a shell object with one method?
  Send a private message to this user    
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic:Can somone please direct me to some ford forums, I need to sell a Falcon!
Next Topic:People requiring info on sprinters and drifting search no more
Goto Forum:
-=] Back to Top [=-

Current Time: Mon Apr 29 07:24:02 UTC 2024

Total time taken to generate the page: 0.0050601959228516 seconds

Bandwidth utilization bar

.:: Contact :: Home ::.

Powered by: FUDforum 2.3.8
Copyright ©2001-2003 Advanced Internet Designs Inc.