|
|
Home » U++ TheIDE » U++ TheIDE: Compiling, Linking, Debugging of your packages » How to link to external libraries
How to link to external libraries [message #11522] |
Sun, 16 September 2007 13:49 |
Ishi
Messages: 5 Registered: July 2007 Location: Middlesbrough, UK
|
Promising Member |
|
|
Hi all.
I've got a .lib and .h file that I want to link to in my project - not sure where I'm going wrong though. The files are in C:\lib\TXF.
In Setup->Build Methods, I've added that directory to the INCLUDE and LIB sections. Then in the Package Organizer I've tried adding TXF.lib as a library, and as various other things, (leaving the When bit empty), but when I try and compile, I just get linker errors about the library's functions not being defined.
If anyone can point out what I might be missing or doing wrong, that'd be brilliant. Thanks in advance!
|
|
|
Re: How to link to external libraries [message #11524 is a reply to message #11522] |
Sun, 16 September 2007 15:51 |
|
mirek
Messages: 13975 Registered: November 2005
|
Ultimate Member |
|
|
Ishi wrote on Sun, 16 September 2007 07:49 | Hi all.
I've got a .lib and .h file that I want to link to in my project - not sure where I'm going wrong though. The files are in C:\lib\TXF.
In Setup->Build Methods, I've added that directory to the INCLUDE and LIB sections. Then in the Package Organizer I've tried adding TXF.lib as a library, and as various other things, (leaving the When bit empty), but when I try and compile, I just get linker errors about the library's functions not being defined.
If anyone can point out what I might be missing or doing wrong, that'd be brilliant. Thanks in advance!
|
Project/Package organizer, click host package, right-click right big pane, choose "New Libraries".
You can look to e.g. Draw or Core package for example how the names of libraries are to be entered.
Mirek
|
|
|
Re: How to link to external libraries [message #11529 is a reply to message #11524] |
Sun, 16 September 2007 18:07 |
Ishi
Messages: 5 Registered: July 2007 Location: Middlesbrough, UK
|
Promising Member |
|
|
Thanks for the reply. Unfortunately I still can't get it to work. I've taken some screenshots so you can see my setup better:
I'm including C:\lib\TXF\TXF.h with a simple #include <TXF.h> which seems to work fine.
I'm trying to use the lib C:\lib\TXF\TXF.lib, and that's the bit that doesn't seem to work for some reason.
My error output is:
Linking...
(option '-O 2' ignored)
File 'libcmt' not found.
File 'oldnames' not found.
File 'libcpmt' not found.
___main: duplicate
-> used: libmingw32.a:gccmain.o:1
-> discarded: libgcc.a:__main.o:1
2 undefined symbol(s):
TXF::Document::Document(char const*)(referenced from c:\upp\out\engineeditor\mingw.debug_full.gui.main\editor-project.o:1; std::__verify_grou
ping(char const*, unsigned int, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&); CEditor::saveProject(bool
); CEditor::saveProject(bool); ...)
TXF::Document::~Document()(referenced from c:\upp\out\engineeditor\mingw.debug_full.gui.main\editor-project.o:1; std::__verify_grouping(char
const*, unsigned int, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&); CEditor::saveProject(bool); CEditor
::saveProject(bool); ...)
linking aborted due to fatal errors
collect2: ld returned 1 exit status
Thanks again for any help, much appreciated.
|
|
|
|
|
Goto Forum:
Current Time: Mon May 06 06:07:28 CEST 2024
Total time taken to generate the page: 0.02575 seconds
|
|
|