![]() |
|
#1
|
|||
|
|||
including external librariesI'm fairly new to C++, and I'm writing a program at Uni for a project. I need to include a library from the Vienna RNA package www.tbi.univie.ac.at to use one of the functions in it.
I am using both linux (g++ compiler) and Windoze (Borland / DevC++), so a solution for either would suit me. I have tried putting #include "fold.h" in my program (the header file that contains the function i want to use - the fold(char *, char *) function), and adding the c source file for that header to my Borland project, but when i try and use the function I get an 'unresolved external' error on compiling. I figure it's something to do with object files, but I don't really get what these are - are they different under linux and win? (they have different file extensions, .o and .obj)? when i use g++ under linux i get a similar error message. could someone pleeeeeeeease tell me what to do, coz i know this is something that should be really easy to accomplish, and it's really annoying me coz all i need is one number from one goddamn function!!!!!!!! just a run-thru of how to include external libraries, either for borland or for linux would be exceptionally useful, or even a link to an appropriate tutorial on the net. Cheers Will |
|
#2
|
|||
|
|||
|
I don't like combining 2 different compilers, I suggest you try to avoid it if possible. Object files *should* be the same no matter which compiler, but there may be differences between the .o file (fron gcc) and .obj (from borland), which the opposing compiler won't like.
Choose one compiler & stick to it. Now. Object files are partially compiled source, files with no main function, just other functions. You've to explicitly tell the g++ compiler to include the .o file when compiling your main program, like so: Code:
Then the compiler knows where these functions are available, and can include them. Hope this helps GF |
Recent GIDBlog
More photos on Flickr by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Including Maps and strings?? | maddie | C++ Forum | 17 | 05-Jul-2004 06:25 |
| Including CGI | JdS | Free Web Hosting | 5 | 08-Nov-2001 23:16 |
| External Stylesheet Question | JdS | Web Design Forum | 3 | 07-Sep-2001 16:48 |
| Including Includes | Guest | Web Design Forum | 1 | 16-Aug-2001 20:31 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The