Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » Problem compiling against a 3rd party lib
Problem compiling against a 3rd party lib [message #209000] Thu, 31 January 2008 16:24 Go to next message
Eclipse UserFriend
Originally posted by: parrym.us.ibm.com

Hi all,
Been a long time since I've used C++ and the CDT and now coming back to
it. I'm trying to use eclipse 3.3.1 with CDT 4.0.1 and the cgywin
toolchain on Windows XP to create an executable.
In specific I have a 3rd party .lib file (actual filename is
qxdaedrsapi.lib) that should have a specific header file in it
(qxdaedrs.h). However when I compile/link it doesn't appear to be
finding that lib file. The output from the console during the build is
below. I have updated the project properties to specify a 'Library path'
in the C++ General -> Paths and Symbols settings that points to the dir
(c:\libs) that contains the 3rd party library. Is there something
obvious I'm missing?


Building file: ../xda_decf001.cpp
Invoking: Cygwin C++ Compiler
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"xda_decf001.d"
-MT"xda_decf001.d" -o"xda_decf001.o" "../xda_decf001.cpp"
In file included from ../xda_decf001.cpp:51:
.../xdahdr.h:26:22: qxdaedrs.h: No such file or directory
Re: Problem compiling against a 3rd party lib [message #209040 is a reply to message #209000] Fri, 01 February 2008 02:16 Go to previous messageGo to next message
Eclipse UserFriend
Mark D. Parry wrote:

> Hi all,
> Been a long time since I've used C++ and the CDT and now coming back to
> it. I'm trying to use eclipse 3.3.1 with CDT 4.0.1 and the cgywin
> toolchain on Windows XP to create an executable.
> In specific I have a 3rd party .lib file (actual filename is
> qxdaedrsapi.lib) that should have a specific header file in it
> (qxdaedrs.h). However when I compile/link it doesn't appear to be
> finding that lib file. The output from the console during the build is
> below. I have updated the project properties to specify a 'Library path'
> in the C++ General -> Paths and Symbols settings that points to the dir
> (c:libs) that contains the 3rd party library. Is there something
> obvious I'm missing?


> Building file: ../xda_decf001.cpp
> Invoking: Cygwin C++ Compiler
> g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"xda_decf001.d"
> -MT"xda_decf001.d" -o"xda_decf001.o" "../xda_decf001.cpp"
> In file included from ../xda_decf001.cpp:51:
> .../xdahdr.h:26:22: qxdaedrs.h: No such file or directory
The compiler does not find the *header file*. You must add the directory
where qxdaedrs.h resides to the include path.

Axel
Re: Problem compiling against a 3rd party lib [message #209767 is a reply to message #209040] Fri, 15 February 2008 13:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: parrym.us.ibm.com

Axel Mueller wrote:
> Mark D. Parry wrote:
>
>> Hi all,
>> Been a long time since I've used C++ and the CDT and now coming
>> back to it. I'm trying to use eclipse 3.3.1 with CDT 4.0.1 and the
>> cgywin toolchain on Windows XP to create an executable.
>> In specific I have a 3rd party .lib file (actual filename is
>> qxdaedrsapi.lib) that should have a specific header file in it
>> (qxdaedrs.h). However when I compile/link it doesn't appear to be
>> finding that lib file. The output from the console during the build is
>> below. I have updated the project properties to specify a 'Library
>> path' in the C++ General -> Paths and Symbols settings that points to
>> the dir (c:libs) that contains the 3rd party library. Is there
>> something obvious I'm missing?
>
>
>> Building file: ../xda_decf001.cpp
>> Invoking: Cygwin C++ Compiler
>> g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"xda_decf001.d"
>> -MT"xda_decf001.d" -o"xda_decf001.o" "../xda_decf001.cpp"
>> In file included from ../xda_decf001.cpp:51:
>> .../xdahdr.h:26:22: qxdaedrs.h: No such file or directory
> The compiler does not find the *header file*. You must add the directory
> where qxdaedrs.h resides to the include path.
>
> Axel
>
>
>
I have the header problem resolved but I'm still not linking to the dll
during linking (I think).... I did add the directory that contains the
dll to the library (which apppears to get passed along to the linker in
the -L param).

Invoking: Cygwin C++ Linker
g++ -L"C:\workspaces\cplusplus\DatabaseTestCases\lib"
-o"DatabaseTestCases.exe" ./xda_decf001.o
../headers/iseries/Include/cwbx_i.o
../xda_decf001.o: In function `main':
/cygdrive/c/workspaces/importtest/DatabaseTestCases/Debug/.. /xda_decf001.cpp:108:
undefined reference to `_QxdaConnectEDRS'
/cygdrive/c/workspaces/importtest/DatabaseTestCases/Debug/.. /xda_decf001.cpp:124:
undefined reference to `_QxdaProcessCommandEDRS'
/cygdrive/c/workspaces/importtest/DatabaseTestCases/Debug/.. /xda_decf001.cpp:141:
undefined reference to `_QxdaProcessCommandEDRS'
/cygdrive/c/workspaces/importtest/DatabaseTestCases/Debug/.. /xda_decf001.cpp:158:
undefined reference to `_QxdaProcessImmediateEDRS'
/cygdrive/c/workspaces/importtest/DatabaseTestCases/Debug/.. /xda_decf001.cpp:181:
undefined reference to `_QxdaProcessImmediateEDRS'
/cygdrive/c/workspaces/importtest/DatabaseTestCases/Debug/.. /xda_decf001.cpp:205:
undefined reference to `_QxdaProcessImmediateEDRS'
/cygdrive/c/workspaces/importtest/DatabaseTestCases/Debug/.. /xda_decf001.cpp:229:
undefined reference to `_QxdaProcessImmediateEDRS'
/cygdrive/c/workspaces/importtest/DatabaseTestCases/Debug/.. /xda_decf001.cpp:249:
undefined reference to `_QxdaCommitEDRS'
/cygdrive/c/workspaces/importtest/DatabaseTestCases/Debug/.. /xda_decf001.cpp:311:
undefined reference to `_QxdaProcessExtDynEDRS'
/cygdrive/c/workspaces/importtest/DatabaseTestCases/Debug/.. /xda_decf001.cpp:377:
undefined reference to `_QxdaProcessExtDynEDRS'
/cygdrive/c/workspaces/importtest/DatabaseTestCases/Debug/.. /xda_decf001.cpp:441:
undefined reference to `_QxdaProcessExtDynEDRS'
/cygdrive/c/workspaces/importtest/DatabaseTestCases/Debug/.. /xda_decf001.cpp:539:
undefined reference to `_QxdaProcessExtDynEDRS'
/cygdrive/c/workspaces/importtest/DatabaseTestCases/Debug/.. /xda_decf001.cpp:651:
undefined reference to `_QxdaProcessExtDynEDRS'
/cygdrive/c/workspaces/importtest/DatabaseTestCases/Debug/.. /xda_decf001.cpp:677:
undefined reference to `_QxdaProcessCommandEDRS'
/cygdrive/c/workspaces/importtest/DatabaseTestCases/Debug/.. /xda_decf001.cpp:694:
undefined reference to `_QxdaDisconnectEDRS'
Re: Problem compiling against a 3rd party lib [message #209861 is a reply to message #209767] Fri, 15 February 2008 18:39 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jim.marshall.wbemsolutions.com

Mark D. Parry wrote:
> Axel Mueller wrote:
>> Mark D. Parry wrote:
>>
>>> Hi all,
>>> Been a long time since I've used C++ and the CDT and now coming
>>> back to it. I'm trying to use eclipse 3.3.1 with CDT 4.0.1 and the
>>> cgywin toolchain on Windows XP to create an executable.
>>> In specific I have a 3rd party .lib file (actual filename is
>>> qxdaedrsapi.lib) that should have a specific header file in it
>>> (qxdaedrs.h). However when I compile/link it doesn't appear to be
>>> finding that lib file. The output from the console during the build
>>> is below. I have updated the project properties to specify a 'Library
>>> path' in the C++ General -> Paths and Symbols settings that points to
>>> the dir (c:libs) that contains the 3rd party library. Is there
>>> something obvious I'm missing?
>>
>>
>>> Building file: ../xda_decf001.cpp
>>> Invoking: Cygwin C++ Compiler
>>> g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"xda_decf001.d"
>>> -MT"xda_decf001.d" -o"xda_decf001.o" "../xda_decf001.cpp"
>>> In file included from ../xda_decf001.cpp:51:
>>> .../xdahdr.h:26:22: qxdaedrs.h: No such file or directory
>> The compiler does not find the *header file*. You must add the
>> directory where qxdaedrs.h resides to the include path.
>>
>> Axel
>>
>>
>>
> I have the header problem resolved but I'm still not linking to the dll
> during linking (I think).... I did add the directory that contains the
> dll to the library (which apppears to get passed along to the linker in
> the -L param).
>
> Invoking: Cygwin C++ Linker
> g++ -L"C:\workspaces\cplusplus\DatabaseTestCases\lib"
> -o"DatabaseTestCases.exe" ./xda_decf001.o
You also need to tell the linker which library to link to (the -l
option). This is specified in the box above where you specified the
directory.

Also please note if the library is exporting C++ interfaces then that
library will *HAVE* to have been compiled with gcc as well (you can't
mix C++ modules between compilers).
Re: Problem compiling against a 3rd party lib [message #209953 is a reply to message #209861] Mon, 18 February 2008 16:53 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: parrym.us.ibm.com

Jim Marshall wrote:
> Mark D. Parry wrote:
>> Axel Mueller wrote:
>>> Mark D. Parry wrote:
>>>
>>>> Hi all,
>>>> Been a long time since I've used C++ and the CDT and now coming
>>>> back to it. I'm trying to use eclipse 3.3.1 with CDT 4.0.1 and the
>>>> cgywin toolchain on Windows XP to create an executable.
>>>> In specific I have a 3rd party .lib file (actual filename is
>>>> qxdaedrsapi.lib) that should have a specific header file in it
>>>> (qxdaedrs.h). However when I compile/link it doesn't appear to be
>>>> finding that lib file. The output from the console during the build
>>>> is below. I have updated the project properties to specify a
>>>> 'Library path' in the C++ General -> Paths and Symbols settings that
>>>> points to the dir (c:libs) that contains the 3rd party library. Is
>>>> there something obvious I'm missing?
>>>
>>>
>>>> Building file: ../xda_decf001.cpp
>>>> Invoking: Cygwin C++ Compiler
>>>> g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"xda_decf001.d"
>>>> -MT"xda_decf001.d" -o"xda_decf001.o" "../xda_decf001.cpp"
>>>> In file included from ../xda_decf001.cpp:51:
>>>> .../xdahdr.h:26:22: qxdaedrs.h: No such file or directory
>>> The compiler does not find the *header file*. You must add the
>>> directory where qxdaedrs.h resides to the include path.
>>>
>>> Axel
>>>
>>>
>>>
>> I have the header problem resolved but I'm still not linking to the
>> dll during linking (I think).... I did add the directory that contains
>> the dll to the library (which apppears to get passed along to the
>> linker in the -L param).
>>
>> Invoking: Cygwin C++ Linker
>> g++ -L"C:\workspaces\cplusplus\DatabaseTestCases\lib"
>> -o"DatabaseTestCases.exe" ./xda_decf001.o
> You also need to tell the linker which library to link to (the -l
> option). This is specified in the box above where you specified the
> directory.
>
> Also please note if the library is exporting C++ interfaces then that
> library will *HAVE* to have been compiled with gcc as well (you can't
> mix C++ modules between compilers).

Jim, Thanks for the pointer. I did as you suggested but I'm still seeing
linker errors. I don't believe the libs I'm trying to use are compiled
with gcc. So are the errors below typical of what you would see if the
compilers were incompatible?

Building target: DatabaseTestCases.exe
Invoking: Cygwin C++ Linker
g++ -L"C:\workspaces\cplusplus\DatabaseTestCases\lib"
-o"DatabaseTestCases.exe" ./xda_decf001.o
../headers/iseries/Include/cwbx_i.o -lqxdaedrs -lcwbapi -lqxdaedrsapi
-lcwblpi
../xda_decf001.o: In function `main':
/cygdrive/c/workspaces/importtest/DatabaseTestCases/Debug/.. /xda_decf001.cpp:108:
undefined reference to `_QxdaConnectEDRS'
/cygdrive/c/workspaces/importtest/DatabaseTestCases/Debug/.. /xda_decf001.cpp:124:
undefined reference to `_QxdaProcessCommandEDRS'
/cygdrive/c/workspaces/importtest/DatabaseTestCases/Debug/.. /xda_decf001.cpp:141:
undefined reference to `_QxdaProcessCommandEDRS'
Re: Problem compiling against a 3rd party lib [message #210310 is a reply to message #209953] Sat, 23 February 2008 00:12 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jim.marshall.wbemsolutions.com

Mark D. Parry wrote:
> Jim Marshall wrote:
>> Mark D. Parry wrote:
>>> Axel Mueller wrote:
>>>> Mark D. Parry wrote:
>>>>
>>>>> Hi all,
>>>>> Been a long time since I've used C++ and the CDT and now coming
>>>>> back to it. I'm trying to use eclipse 3.3.1 with CDT 4.0.1 and the
>>>>> cgywin toolchain on Windows XP to create an executable.
>>>>> In specific I have a 3rd party .lib file (actual filename is
>>>>> qxdaedrsapi.lib) that should have a specific header file in it
>>>>> (qxdaedrs.h). However when I compile/link it doesn't appear to be
>>>>> finding that lib file. The output from the console during the build
>>>>> is below. I have updated the project properties to specify a
>>>>> 'Library path' in the C++ General -> Paths and Symbols settings
>>>>> that points to the dir (c:libs) that contains the 3rd party
>>>>> library. Is there something obvious I'm missing?
>>>>
>>>>
>>>>> Building file: ../xda_decf001.cpp
>>>>> Invoking: Cygwin C++ Compiler
>>>>> g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"xda_decf001.d"
>>>>> -MT"xda_decf001.d" -o"xda_decf001.o" "../xda_decf001.cpp"
>>>>> In file included from ../xda_decf001.cpp:51:
>>>>> .../xdahdr.h:26:22: qxdaedrs.h: No such file or directory
>>>> The compiler does not find the *header file*. You must add the
>>>> directory where qxdaedrs.h resides to the include path.
>>>>
>>>> Axel
>>>>
>>>>
>>>>
>>> I have the header problem resolved but I'm still not linking to the
>>> dll during linking (I think).... I did add the directory that
>>> contains the dll to the library (which apppears to get passed along
>>> to the linker in the -L param).
>>>
>>> Invoking: Cygwin C++ Linker
>>> g++ -L"C:\workspaces\cplusplus\DatabaseTestCases\lib"
>>> -o"DatabaseTestCases.exe" ./xda_decf001.o
>> You also need to tell the linker which library to link to (the -l
>> option). This is specified in the box above where you specified the
>> directory.
>>
>> Also please note if the library is exporting C++ interfaces then that
>> library will *HAVE* to have been compiled with gcc as well (you can't
>> mix C++ modules between compilers).
>
> Jim, Thanks for the pointer. I did as you suggested but I'm still seeing
> linker errors. I don't believe the libs I'm trying to use are compiled
> with gcc. So are the errors below typical of what you would see if the
> compilers were incompatible?
>
> Building target: DatabaseTestCases.exe
> Invoking: Cygwin C++ Linker
> g++ -L"C:\workspaces\cplusplus\DatabaseTestCases\lib"
> -o"DatabaseTestCases.exe" ./xda_decf001.o
> ./headers/iseries/Include/cwbx_i.o -lqxdaedrs -lcwbapi -lqxdaedrsapi
> -lcwblpi
> ./xda_decf001.o: In function `main':
> /cygdrive/c/workspaces/importtest/DatabaseTestCases/Debug/.. /xda_decf001.cpp:108:
> undefined reference to `_QxdaConnectEDRS'
> /cygdrive/c/workspaces/importtest/DatabaseTestCases/Debug/.. /xda_decf001.cpp:124:
> undefined reference to `_QxdaProcessCommandEDRS'
> /cygdrive/c/workspaces/importtest/DatabaseTestCases/Debug/.. /xda_decf001.cpp:141:
> undefined reference to `_QxdaProcessCommandEDRS'
These names do not appear to be C++ decorated names, but I am not sure
of that. Does the library you are using have a function called
"QxdaConnectEDRS"? If so which library is it located in? You can use the
'nm' tool to see what functions are exported from the libraries.
Re: Problem compiling against a 3rd party lib [message #210434 is a reply to message #210310] Mon, 25 February 2008 22:35 Go to previous message
Eclipse UserFriend
GCC has the following lib convention:
-L<path_to_lib>
-l<name_of_lib> where the lib-file is actually named lib<name_of_lib>.a

e.g. C:/xyz/lib/libmylib.a
-> g++ -o main.o -c main.cpp -IC:/xyz/include
-> g++ -o myexec.exe main.o -LC:/xyz/lib -lmylib

So if you have libs e.g. made in windows MSVC you probably have to add
<path_to_lib>/<name_of_lib>.lib
e.g. C:/xyz/lib/mylib.lib
-> g++ -o main.o -c main.cpp -IC:/xyz/include
-> g++ -o myexec.exe main.o C:/xyz/lib/mylib.lib


Jim Marshall schrieb:
> Mark D. Parry wrote:
>> Jim Marshall wrote:
>>> Mark D. Parry wrote:
>>>> Axel Mueller wrote:
>>>>> Mark D. Parry wrote:
>>>>>
>>>>>> Hi all,
>>>>>> Been a long time since I've used C++ and the CDT and now
>>>>>> coming back to it. I'm trying to use eclipse 3.3.1 with CDT 4.0.1
>>>>>> and the cgywin toolchain on Windows XP to create an executable.
>>>>>> In specific I have a 3rd party .lib file (actual filename is
>>>>>> qxdaedrsapi.lib) that should have a specific header file in it
>>>>>> (qxdaedrs.h). However when I compile/link it doesn't appear to be
>>>>>> finding that lib file. The output from the console during the
>>>>>> build is below. I have updated the project properties to specify a
>>>>>> 'Library path' in the C++ General -> Paths and Symbols settings
>>>>>> that points to the dir (c:libs) that contains the 3rd party
>>>>>> library. Is there something obvious I'm missing?
>>>>>
>>>>>
>>>>>> Building file: ../xda_decf001.cpp
>>>>>> Invoking: Cygwin C++ Compiler
>>>>>> g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP
>>>>>> -MF"xda_decf001.d" -MT"xda_decf001.d" -o"xda_decf001.o"
>>>>>> "../xda_decf001.cpp"
>>>>>> In file included from ../xda_decf001.cpp:51:
>>>>>> .../xdahdr.h:26:22: qxdaedrs.h: No such file or directory
>>>>> The compiler does not find the *header file*. You must add the
>>>>> directory where qxdaedrs.h resides to the include path.
>>>>>
>>>>> Axel
>>>>>
>>>>>
>>>>>
>>>> I have the header problem resolved but I'm still not linking to the
>>>> dll during linking (I think).... I did add the directory that
>>>> contains the dll to the library (which apppears to get passed along
>>>> to the linker in the -L param).
>>>>
>>>> Invoking: Cygwin C++ Linker
>>>> g++ -L"C:\workspaces\cplusplus\DatabaseTestCases\lib"
>>>> -o"DatabaseTestCases.exe" ./xda_decf001.o
>>> You also need to tell the linker which library to link to (the -l
>>> option). This is specified in the box above where you specified the
>>> directory.
>>>
>>> Also please note if the library is exporting C++ interfaces then that
>>> library will *HAVE* to have been compiled with gcc as well (you can't
>>> mix C++ modules between compilers).
>>
>> Jim, Thanks for the pointer. I did as you suggested but I'm still
>> seeing linker errors. I don't believe the libs I'm trying to use are
>> compiled with gcc. So are the errors below typical of what you would
>> see if the compilers were incompatible?
>>
>> Building target: DatabaseTestCases.exe
>> Invoking: Cygwin C++ Linker
>> g++ -L"C:\workspaces\cplusplus\DatabaseTestCases\lib"
>> -o"DatabaseTestCases.exe" ./xda_decf001.o
>> ./headers/iseries/Include/cwbx_i.o -lqxdaedrs -lcwbapi -lqxdaedrsapi
>> -lcwblpi
>> ./xda_decf001.o: In function `main':
>> /cygdrive/c/workspaces/importtest/DatabaseTestCases/Debug/.. /xda_decf001.cpp:108:
>> undefined reference to `_QxdaConnectEDRS'
>> /cygdrive/c/workspaces/importtest/DatabaseTestCases/Debug/.. /xda_decf001.cpp:124:
>> undefined reference to `_QxdaProcessCommandEDRS'
>> /cygdrive/c/workspaces/importtest/DatabaseTestCases/Debug/.. /xda_decf001.cpp:141:
>> undefined reference to `_QxdaProcessCommandEDRS'
> These names do not appear to be C++ decorated names, but I am not sure
> of that. Does the library you are using have a function called
> "QxdaConnectEDRS"? If so which library is it located in? You can use the
> 'nm' tool to see what functions are exported from the libraries.
>
>
Previous Topic:clicking debug causes Release build
Next Topic:resource_loc not updated reliably
Goto Forum:
  


Current Time: Sun May 11 18:30:00 EDT 2025

Powered by FUDForum. Page generated in 0.02747 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top