By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,234 Members | 1,889 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,234 IT Pros & Developers. It's quick & easy.

g++ -o Problem

P: n/a
Hi All
I'm working in c++ a long time ago, actually i'm java developer, but
need to compile a cpp class to make one integration in a EAI solution.
When run the next link option
g++ obj/CreateXmlDocument.o -o "bin\CreateXmlDocument.exe"
-L"C:/dir/lib"
i receive the next error
obj/CreateXmlDocument.o(.text+0x17f):CreateXmlDocument .cpp: undefined
reference to `rwsf::sdo::DataFactory::getDataFactory()'
and others similars
i suppose need some lib file but i put them in C:/dir/lib, what more
need to do?

Jun 12 '06 #1
Share this Question
Share on Google+
7 Replies


P: n/a

Cartman wrote:
Hi All
I'm working in c++ a long time ago, actually i'm java developer, but
need to compile a cpp class to make one integration in a EAI solution.
When run the next link option
g++ obj/CreateXmlDocument.o -o "bin\CreateXmlDocument.exe"
-L"C:/dir/lib"
i receive the next error
obj/CreateXmlDocument.o(.text+0x17f):CreateXmlDocument .cpp: undefined
reference to `rwsf::sdo::DataFactory::getDataFactory()'
and others similars
i suppose need some lib file but i put them in C:/dir/lib, what more
need to do?


You need to specify the library to link against. Use -l switch.
P.Krumins

Jun 12 '06 #2

P: n/a
Peteris Krumins wrote:
Cartman wrote:
Hi All
I'm working in c++ a long time ago, actually i'm java developer, but
need to compile a cpp class to make one integration in a EAI solution.
When run the next link option
g++ obj/CreateXmlDocument.o -o "bin\CreateXmlDocument.exe"
-L"C:/dir/lib"
i receive the next error
obj/CreateXmlDocument.o(.text+0x17f):CreateXmlDocument .cpp: undefined
reference to `rwsf::sdo::DataFactory::getDataFactory()'
and others similars
i suppose need some lib file but i put them in C:/dir/lib, what more
need to do?


You need to specify the library to link against. Use -l switch.

P.Krumins


Something like
g++ obj/CreateXmlDocument.o -o "bin\CreateXmlDocument.exe"
-L"C:/Dir/lib" -l C:/dir/lib/libname.lib ?
i try but receive
....ld.exe: cannot find -l C:/dir/lib/namelib.lib

Jun 12 '06 #3

P: n/a

Cartman wrote:
Something like
g++ obj/CreateXmlDocument.o -o "bin\CreateXmlDocument.exe"
-L"C:/Dir/lib" -l C:/dir/lib/libname.lib ?
i try but receive
...ld.exe: cannot find -l C:/dir/lib/namelib.lib


Why don't you ask this question in a group dedicated to your compiler
and platform?

Jun 12 '06 #4

P: n/a
Cartman wrote:
Hi All
I'm working in c++ a long time ago, actually i'm java developer, but
need to compile a cpp class to make one integration in a EAI solution.
When run the next link option
g++ obj/CreateXmlDocument.o -o "bin\CreateXmlDocument.exe"
-L"C:/dir/lib"
i receive the next error
obj/CreateXmlDocument.o(.text+0x17f):CreateXmlDocument .cpp: undefined
reference to `rwsf::sdo::DataFactory::getDataFactory()'
and others similars
i suppose need some lib file but i put them in C:/dir/lib, what more
need to do?


You've got a couple suggestions already, but the best one is to ask in a
g++ group, specifically gnu.g++.help, as they will be able to give you a
more detailed, specific (and more likely to be correct -- no offense
intended to those who've already answered) answer.

In addition, this newsgroup discusses the language itself, not how to
use vendor specific tools, so while you're actually OT here, you'd be on
topic in gnu.g++.help.

Jun 12 '06 #5

P: n/a
> Something like
g++ obj/CreateXmlDocument.o -o "bin\CreateXmlDocument.exe"
-L"C:/Dir/lib" -l C:/dir/lib/libname.lib ?
i try but receive
...ld.exe: cannot find -l C:/dir/lib/namelib.lib


If you library is named libname.lib, then specify -l name
Otherwise, drop the -l and just specify C:/dir/lib/namelib.lib
P.Krumins

Jun 12 '06 #6

P: n/a
Peteris Krumins wrote:
Something like
g++ obj/CreateXmlDocument.o -o "bin\CreateXmlDocument.exe"
-L"C:/Dir/lib" -l C:/dir/lib/libname.lib ?
i try but receive
...ld.exe: cannot find -l C:/dir/lib/namelib.lib


If you library is named libname.lib, then specify -l name
Otherwise, drop the -l and just specify C:/dir/lib/namelib.lib
P.Krumins


Not Peteris receive the same error

Jun 12 '06 #7

P: n/a
In, windows style path: "C:/dir/lib/...", tryp double "//" instead of
single "/" -Vacu
Cartman wrote:
Peteris Krumins wrote:
Something like
g++ obj/CreateXmlDocument.o -o "bin\CreateXmlDocument.exe"
-L"C:/Dir/lib" -l C:/dir/lib/libname.lib ?
i try but receive
...ld.exe: cannot find -l C:/dir/lib/namelib.lib


If you library is named libname.lib, then specify -l name
Otherwise, drop the -l and just specify C:/dir/lib/namelib.lib
P.Krumins


Not Peteris receive the same error


Jun 13 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.