Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ TheIDE » U++ TheIDE: Compiling, Linking, Debugging of your packages » LIB from Visual C++ cannot link to UPP package
LIB from Visual C++ cannot link to UPP package [message #5677] Mon, 09 October 2006 14:15 Go to next message
zaurus is currently offline  zaurus
Messages: 42
Registered: May 2006
Member
Hi!

Is it basically possible to create a library with Visual C++ and then use it in a UPP package?

I tried and copied the lib-file and header-files into the package folder and then included it in the package. I also change the settings und 'Build Methods' to include the path to my lib-file, but I always get problems during linking. Some unresolved references.

Thanks for any help.
Re: LIB from Visual C++ cannot link to UPP package [message #5678 is a reply to message #5677] Mon, 09 October 2006 14:43 Go to previous messageGo to next message
zsolt is currently offline  zsolt
Messages: 697
Registered: December 2005
Location: Budapest, Hungary
Contributor
Isn't it possible that your lib contains some references to other libs?
Re: LIB from Visual C++ cannot link to UPP package [message #5681 is a reply to message #5678] Mon, 09 October 2006 15:27 Go to previous messageGo to next message
zaurus is currently offline  zaurus
Messages: 42
Registered: May 2006
Member
That might be possible. I thought libs are statically linked and so should include everything, but I will check it this area.

Thanks for the super fast answer.
Re: LIB from Visual C++ cannot link to UPP package [message #5717 is a reply to message #5677] Wed, 11 October 2006 07:45 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Well, you decription of the process is a little bit fuzzy to me.

The right simple way how to use external library is to add it in package organizer to the package that needs it - right click to the right pane and choose "Add library...".

Mirek
Re: LIB from Visual C++ cannot link to UPP package [message #5919 is a reply to message #5717] Wed, 25 October 2006 12:44 Go to previous messageGo to next message
cioannou is currently offline  cioannou
Messages: 45
Registered: January 2006
Location: Greece
Member
That's exactly what I did and when linking I get a nice message:


Linking...
\mingw\lib\gcc\mingw32\3.4.2\..\..\..\..\mingw32\bin\ld.exe: cannot find -llibboost_filesystem-mgw-s-1_33_1.lib
collect2: ld returned 1 exit status



And I have added the c:\upp\myapps\mysqldemo dir in Package Organizer->Link Options

-Lc:\upp\myapps\mysqldemo

[Updated on: Wed, 25 October 2006 12:46]

Report message to a moderator

Re: LIB from Visual C++ cannot link to UPP package [message #5940 is a reply to message #5677] Wed, 25 October 2006 15:25 Go to previous messageGo to next message
yeohhs
Messages: 75
Registered: November 2005
Location: Malaysia
Member
Hi,

If you are using MinGW in Ultimate++, there will be problems when linking Visual C++ libs with your project. This is because the MinGW .a library files are not compatible with Visual C++'s .lib files.

If you use MSC7.1 or MSC8 in Ultimate++, there should be no problems.

Hope this helps.

Best Regards,
Yeoh
Re: LIB from Visual C++ cannot link to UPP package [message #5943 is a reply to message #5940] Wed, 25 October 2006 15:55 Go to previous messageGo to next message
cioannou is currently offline  cioannou
Messages: 45
Registered: January 2006
Location: Greece
Member
yeohhs wrote on Wed, 25 October 2006 16:25

Hi,

If you are using MinGW in Ultimate++, there will be problems when linking Visual C++ libs with your project. This is because the MinGW .a library files are not compatible with Visual C++'s .lib files.

If you use MSC7.1 or MSC8 in Ultimate++, there should be no problems.

Hope this helps.

Best Regards,
Yeoh



Actually, I built Boost using both mingw and VC so I have two different libs. But the same error is displayed in VC also.

Linking...
LINK : fatal error LNK1104: cannot open file 'libboost_filesystem-vc71-sgd-1_33_1.lib'
Re: LIB from Visual C++ cannot link to UPP package [message #5944 is a reply to message #5943] Wed, 25 October 2006 16:13 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Hint: There is "Verbose" option in Setup menu. Activate that to see which commandline options are actually send to compiler and linker.

Fastest way how to figure out what is wrong.

Mirek
Re: LIB from Visual C++ cannot link to UPP package [message #5945 is a reply to message #5943] Wed, 25 October 2006 16:54 Go to previous messageGo to next message
yeohhs
Messages: 75
Registered: November 2005
Location: Malaysia
Member
cioannou wrote on Wed, 25 October 2006 21:55


Actually, I built Boost using both mingw and VC so I have two different libs. But the same error is displayed in VC also.
Linking...
LINK : fatal error LNK1104: cannot open file 'libboost_filesystem-vc71-sgd-1_33_1.lib'



Hello,

Sorry about my incorrect assumption earlier.

From your linker error, it looks like the linker cannot find the .lib file. Is the file libboost_filesystem-vc71-sgd-1_33_1.lib created? And in which folder is it in? You'll probably need to re-check your libraries path.

Best Regards,
Yeoh


Re: LIB from Visual C++ cannot link to UPP package [message #5984 is a reply to message #5945] Thu, 26 October 2006 16:29 Go to previous messageGo to next message
cioannou is currently offline  cioannou
Messages: 45
Registered: January 2006
Location: Greece
Member
From the error message I get, that's the assumption I made too.

Checked and re-checked the paths and filenames (copy/paste) but still getting the same message, no matter if I use the mingw or the VC .lib

Here is what I do:

a) Build-Methods-> LIB-directories for lib files-> Copy & Paste the path from my explorer window.
C:\Dev-Cpp\include\boost\bin\boost\libs\filesystem\build\lib boost_filesystem.lib\mingw\release\runtime-link-static
b) Package Organizer->New Libraries-> Copy & Paste the lib filename from the previous explorer window.
libboost_filesystem-mgw-s-1_33_1.lib

F7 (Build)

I Even tried to put the full path and filename in Package Organizer, but I get the same message.

That's all

(Same logic works in Dev-C++)

[Updated on: Thu, 26 October 2006 16:32]

Report message to a moderator

Re: LIB from Visual C++ cannot link to UPP package [message #5985 is a reply to message #5984] Thu, 26 October 2006 16:33 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Have you tried the verbose mode to see what is happening?

Mirek
Re: LIB from Visual C++ cannot link to UPP package [message #5987 is a reply to message #5985] Thu, 26 October 2006 17:18 Go to previous messageGo to next message
cioannou is currently offline  cioannou
Messages: 45
Registered: January 2006
Location: Greece
Member
luzr wrote on Thu, 26 October 2006 17:33

Have you tried the verbose mode to see what is happening?

Mirek



Yes, I did, nothing helpful, the -lc:\...\boost...lib parameter is included but I get the same error.
Re: LIB from Visual C++ cannot link to UPP package [message #5988 is a reply to message #5987] Thu, 26 October 2006 17:23 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Then the problem is most likely with library format or name.

As the first thing I would try to rename the file to some shorter name (just as experiment).

Mirek
Re: LIB from Visual C++ cannot link to UPP package [message #6000 is a reply to message #5988] Fri, 27 October 2006 10:23 Go to previous messageGo to next message
cioannou is currently offline  cioannou
Messages: 45
Registered: January 2006
Location: Greece
Member
luzr wrote on Thu, 26 October 2006 18:23

Then the problem is most likely with library format or name.

As the first thing I would try to rename the file to some shorter name (just as experiment).

Mirek


Thanks, but already tried it.

-lc:\myapps\demoapp\boost.lib

Same error
Re: LIB from Visual C++ cannot link to UPP package [message #6003 is a reply to message #6000] Fri, 27 October 2006 11:33 Go to previous messageGo to next message
yeohhs
Messages: 75
Registered: November 2005
Location: Malaysia
Member
This is very strange.

Quote:


(Same logic works in Dev-C++)



Have you tried to generate a makefile in Dev-C++ and in U++ and compare the compiler and linker settings?


Re: LIB from Visual C++ cannot link to UPP package [message #6004 is a reply to message #6003] Fri, 27 October 2006 11:37 Go to previous messageGo to next message
cioannou is currently offline  cioannou
Messages: 45
Registered: January 2006
Location: Greece
Member
yeohhs wrote on Fri, 27 October 2006 12:33

This is very strange.

Quote:


(Same logic works in Dev-C++)



Have you tried to generate a makefile in Dev-C++ and in U++ and compare the compiler and linker settings?






That's beyond my skills.

In order to build the boost libraries I followed the boost build instructions and used the "bjam" utility. Afterwards I just included the lib in my Dev-Cpp project and it just worked.

Re: LIB from Visual C++ cannot link to UPP package [message #6005 is a reply to message #6004] Fri, 27 October 2006 13:39 Go to previous messageGo to next message
cioannou is currently offline  cioannou
Messages: 45
Registered: January 2006
Location: Greece
Member
uses
	CtrlLib,
	MySql,
	Sql;

options
	-IC:\Dev-Cpp\include\boost,
	-Ic:\upp\myapps\mysqldemo;

file
	MysqlDemo.h,
	main.cpp charset "windows-1253",
	MysqlDemo.lay;

mainconfig
	"" = "GUI";



That's my upp file, I don't see any linker options in here. Should they be included?

If "Be verbose" is enabled then I can see the -L flag appended which means that the library dirs are included.
Re: LIB from Visual C++ cannot link to UPP package [message #6006 is a reply to message #6005] Fri, 27 October 2006 14:33 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
I think I suspect where the problem is...

You have added -l option to the build method compiler options. But that is not right, those options are just to compile the file, not for linking. (Please check if in verbose mode there is -l in _LINKING_ step).

You should add it in package organizer as "Add library...".

Mirek
Re: LIB from Visual C++ cannot link to UPP package [message #6007 is a reply to message #6006] Fri, 27 October 2006 16:24 Go to previous messageGo to next message
cioannou is currently offline  cioannou
Messages: 45
Registered: January 2006
Location: Greece
Member
Here are my screens.

http://img252.imageshack.us/my.php?image=uppbuildmethodsxp4. png

http://img79.imageshack.us/my.php?image=uppbuildmethods2vi3. png




[Updated on: Fri, 27 October 2006 16:29]

Report message to a moderator

Re: LIB from Visual C++ cannot link to UPP package [message #6030 is a reply to message #6007] Sun, 29 October 2006 03:58 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Well, you are showing settings for mingw build method, but in your package organizer, there is .lib extension for the library.

That cannot work.
Previous Topic: uxtheme does not work with Ultimate++ 2007.1beta3
Next Topic: MS Com and Unicode issue
Goto Forum:
  


Current Time: Tue Apr 30 18:44:55 CEST 2024

Total time taken to generate the page: 0.02567 seconds