IPB SourceForge.net Logo

Welcome Guest ( Log In | Register )

[ Outline ] · Standard · Linear+

> What libs are needed for static linking?

mispunt
post Jun 16 2006, 09:23 AM
Post #1


Advanced Member
***

Group: Members
Posts: 77
Joined: 20-May 06
Member No.: 229



As said in another topic, I try to use vcf as a static lib. But when I try to compile a simple program which views a single window I get a lot of undefined references here is the compiler output, the first line is what I include and in which order:
CODE
mingw32-g++.exe -LC:\Development\vcf\lib -LC:\Compilers\MinGW\lib  -o bin\debug\pim-vcf.exe .objs\debug\pim-vcf\main.o .objs\debug\pim-vcf\app.o    -lApplicationKit_mgcc_sd -lGraphicsKit_mgcc_sd -lFoundationKit_mgcc_sd -lAGG_mgcc_sd -lLibJPEG_mgcc_sd -lLibPNG_mgcc_sd -lZLib_mgcc_sd -lrpcrt4 -lodbc32 -lodbccp32 -lversion -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lcomctl32 -lws2_32 -lopengl32 -lglu32
C:\Development\vcf\lib/libApplicationKit_mgcc_sd.a(Application.o)(.text+0x14d):Application.cpp: undefined reference to `VCF::LibraryApplication::getRegisteredLibraries()'
C:\Development\vcf\lib/libApplicationKit_mgcc_sd.a(Application.o)(.text+0x8ac):Application.cpp: undefined reference to `VCF::LibraryApplication::getRegisteredLibraries()'
C:\Development\vcf\lib/libApplicationKit_mgcc_sd.a(PopupMenu.o)(.text+0x14d):PopupMenu.cpp: undefined reference to `VCF::Menu::Menu()'
C:\Development\vcf\lib/libApplicationKit_mgcc_sd.a(PopupMenu.o)(.text+0x519):PopupMenu.cpp: undefined reference to `VCF::Menu::~Menu()'
---snip---
C:\Development\vcf\lib/libApplicationKit_mgcc_sd.a(PopupMenu.o)(.text+0xa08):PopupMenu.cpp: undefined reference to `VCF::Menu::Menu(VCF::Component*)'
---snip---
C:\Development\vcf\lib/libApplicationKit_mgcc_sd.a(PopupMenu.o)(.text+0x1253):PopupMenu.cpp: undefined reference to `VCF::Menu::Menu(VCF::UnicodeString const&, VCF::Component*)'
---snip---
C:\Development\vcf\lib/libApplicationKit_mgcc_sd.a(PopupMenu.o)(.text+0x1aa0):PopupMenu.cpp: undefined reference to `VCF::Menu::Menu(VCF::UnicodeString const&)'
---snip---
C:\Development\vcf\lib/libApplicationKit_mgcc_sd.a(PopupMenu.o)(.text+0x259f):PopupMenu.cpp: undefined reference to `VCF::Menu::destroy()'
C:\Development\vcf\lib/libApplicationKit_mgcc_sd.a(PopupMenu.o)(.text+0x2658):PopupMenu.cpp: undefined reference to `VCF::Menu::setRootMenuItem(VCF::MenuItem*)'
C:\Development\vcf\lib/libApplicationKit_mgcc_sd.a(PopupMenu.o)(.text+0x2663):PopupMenu.cpp: undefined reference to `VCF::Menu::getRootMenuItem()'
C:\Development\vcf\lib/libApplicationKit_mgcc_sd.a(PopupMenu.o)(.rdata$_ZTVN3VCF9PopupMenuE[vtable for VCF::PopupMenu]+0x30):PopupMenu.cpp: undefined reference to `VCF::Menu::handleEvent(VCF::Event*)'
---snip---

SAME FOR MenuBar.o

---snip---
C:\Development\vcf\lib/libApplicationKit_mgcc_sd.a(ApplicationKit.o)(.text+0xe99):ApplicationKit.cpp: undefined reference to `VCF::LibraryApplication::initLibraryRegistrar()'
Do I miss some libs?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
 
Reply to this topicStart new topicStart Poll
Replies
kdmix
post Jun 16 2006, 10:11 AM
Post #2


Advanced Member
***

Group: Members
Posts: 316
Joined: 24-May 05
Member No.: 158



QUOTE(mispunt @ Jun 16 2006, 01:23 PM)
Do I miss some libs?

The following command line works (this is an excerpt from a make file):
CODE

.\helloworld$(OPTION_SELECTLIB)$(SUFFIX_LIBRARY).exe: $(HELLOWORLD_OBJECTS)
$(CXX) -o $@ $(HELLOWORLD_OBJECTS) $(LDFLAGS) $(__DEBUG_INFO) -mthreads -Wl,--enable-runtime-pseudo-reloc -L"$(VCF_ROOT)\lib" -Wl,--subsystem,windows -mwindows  $(____helloworld_APPLICATIONKIT_p) $(____helloworld_GRAPHICSKIT_p) $(____helloworld_FOUNDATIONKIT_p) -l$(LIBAGG_FILENAME) -l$(ZLIB_FILENAME) -l$(LIBJPEG_FILENAME) -l$(LIBPNG_FILENAME) -lrpcrt4 -lodbc32 -lodbccp32 -lversion -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lcomctl32 -lws2_32 -lopengl32 -lglu32

It looks like you just need to add a couple of linker flags. Or maybe even one: -Wl,--enable-runtime-pseudo-reloc.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Posts in this topic
mispunt   What libs are needed for static linking?   Jun 16 2006, 09:23 AM
kdmix   The following command line works (this is an exce...   Jun 16 2006, 10:11 AM
mispunt   hmm. no luck for me :( I will try to compile those...   Jun 16 2006, 10:45 AM
kdmix   No I didn't. I use my favorite editor and a c...   Jun 16 2006, 11:18 AM
ddiego   It looks to me like your're missing some CPP f...   Jun 16 2006, 03:45 PM
mispunt   Yes it helps. looks like the codeblocks project is...   Jun 16 2006, 09:14 PM
vortic   Do you prefer the AGG library name be "AGG...   Jun 16 2006, 11:37 PM
ddiego   In the linux target I used "AGG". I...   Jun 17 2006, 12:41 AM
vortic   In addition to those, the C::B project file for s...   Jun 17 2006, 12:33 AM
ddiego   In addition to those, the C::B project file for s...   Jun 17 2006, 12:42 AM
kdmix   The Color.cpp file is a part of the GraphicsKit,...   Jun 17 2006, 07:21 AM
vortic   As you know, this is a unix style of naming libra...   Jun 17 2006, 12:52 PM
kdmix   It's not a problem to change the name. All th...   Jun 17 2006, 01:36 PM
vortic   Hi Mispunt, I updated the ApplicationKit codebloc...   Jun 17 2006, 04:41 AM
vortic   The above #'s were from when I optimized for...   Jun 17 2006, 05:20 PM
kdmix   Do we want to change names of the other libraries?   Jun 17 2006, 01:53 PM
vortic   I don't think so. For example, the other libr...   Jun 17 2006, 02:21 PM
mispunt   strange, I can't compile the HelloWorld examp...   Jun 17 2006, 06:18 PM
vortic   strange, I can't compile the HelloWorld examp...   Jun 17 2006, 11:30 PM
mispunt   Sorry didn't test that... recompiling now...   Jun 18 2006, 12:08 PM
kdmix   I've committed changes that fix the problem wi...   Jun 18 2006, 12:32 PM
mispunt   I didn't test the Bakefile build, but I tested...   Jun 18 2006, 06:03 PM
mispunt   Well it looks like that almost all the framework i...   Jun 18 2006, 08:52 PM
vortic   Well it looks like that almost all the framework i...   Jun 18 2006, 09:23 PM
ddiego   It didn't use to. I remember trying a few di...   Jun 19 2006, 02:35 AM
ddiego   You mean 400 instances right? The VCF debug memo...   Jun 19 2006, 02:35 AM
mispunt   Yes I think so (don't have it here in front o...   Jun 19 2006, 06:10 AM
ddiego   Here we are "damed if we do, and damned if ...   Jun 20 2006, 06:40 PM
mispunt   In revision 2788 Collor.h is broken again with the...   Jun 20 2006, 07:55 AM
kdmix   [snapback]6398 You are right it was broken with...   Jun 20 2006, 12:39 PM
kdmix   Done at 2789.   Jun 20 2006, 12:43 PM


Reply to this topicTopic OptionsStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
 

Lo-fi Version : 19th May 2013 - 04:37 AM