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: Other Features Wishlist and/or Bugs » Possible bug
Possible bug [message #7854] Fri, 26 January 2007 18:11 Go to next message
fithisux is currently offline  fithisux
Messages: 12
Registered: January 2007
Promising Member
I use windows xp SP2, and the proposed 3.4.5 mingw toolchain.

I try to link a small app I have written with libxml2. I downloaded the binaries from http://www.zlatkovic.com/pub/libxml/

and I decompressed all in my c:\xmlsoft_distro folder with layout

c:\xmlsoft_distro\bin
c:\xmlsoft_distro\lib
c:\xmlsoft_distro\include
..... blah .. blah

My app is TestXML. When the linker tries to generate according to mingw I have to do something like (in MSYS)

g++ -mwindows -mconsole -c TextXML.cpp -I"c:/xmlsoft_distro/lib"

and for linking (you have to put the full path to the lib, because mingw views it like an object file)

g++ -mwindows -mconsole -o TestXML.exe TestXML.o c:/xmlsoft_distro/libxml2.lib

It works fine.

Upp 2007.1.Beta2 does something similar for compilation and works but for linking it does something similar to

g++ -mwindows -mconsole -o TestXML.exe c:/xmlsoft_distro/libxml2.lib TestXML.o

which fails.

Can you take a look? .exe and .o must be switched I think. I used http://www.xmlsoft.org/examples/index.html#tree1.c as TreeXML.cpp

Solve some minor bugs and VS will be phased out. Thanks for the great IDE.
Re: Possible bug [message #7858 is a reply to message #7854] Fri, 26 January 2007 23:47 Go to previous messageGo to next message
fallingdutch is currently offline  fallingdutch
Messages: 258
Registered: July 2006
Experienced Member
fithisux wrote on Fri, 26 January 2007 18:11


Upp 2007.1.Beta2 does something similar for compilation and works but for linking it does something similar to

g++ -mwindows -mconsole -o TestXML.exe c:/xmlsoft_distro/libxml2.lib TestXML.o

which fails.

Can you take a look? .exe and .o must be switched I think. I used http://www.xmlsoft.org/examples/index.html#tree1.c as TreeXML.cpp



the -o option means "save output as" so -o should be followed by TestXML.exe.

But i have no clue why it fails.

btw: why don't you use the xml shipped with upp (Core/Xml)?
examples: XmlView
reference: XML and Xmlize

Bas
Re: Possible bug [message #7885 is a reply to message #7858] Sun, 28 January 2007 22:47 Go to previous messageGo to next message
fithisux is currently offline  fithisux
Messages: 12
Registered: January 2007
Promising Member
Sorry , my mistake.


I think .lib and .o must be swapped.


And about xml shipped with UPP, I agree with you but for now my work is being done with libxml2. I will evaluate the classes by UP later. Do you believe that it is a UPP bug or a mingw bug? Any fedback by other viewers?

Sorry again for my erroneous way of stating my report.
Re: Possible bug [message #7902 is a reply to message #7885] Wed, 31 January 2007 00:40 Go to previous messageGo to next message
fithisux is currently offline  fithisux
Messages: 12
Registered: January 2007
Promising Member
Any replies yet? I think the problem is in the location of the .lib files. I need to port CoreLibrary and possible xerces-c to mingw by creating upp project files. Give me a hint. Has anyone managed to link .lib under mingw with UPP yet?
Re: Possible bug [message #7903 is a reply to message #7854] Wed, 31 January 2007 08:17 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
fithisux wrote on Fri, 26 January 2007 12:11


Upp 2007.1.Beta2 does something similar for compilation and works but for linking it does something similar to

g++ -mwindows -mconsole -o TestXML.exe c:/xmlsoft_distro/libxml2.lib TestXML.o

which fails.

Can you take a look? .exe and .o must be switched I think. I used http://www.xmlsoft.org/examples/index.html#tree1.c as TreeXML.cpp

Solve some minor bugs and VS will be phased out. Thanks for the great IDE.


Sorry for the delay...

Well, how do you put the .lib into the project?

The correct way is to add path to lib to build method, then use "Add library" in package organizer. I believe that this way cannot produce the above commandline.

Mirek
Re: Possible bug [message #7909 is a reply to message #7903] Wed, 31 January 2007 09:52 Go to previous messageGo to next message
fithisux is currently offline  fithisux
Messages: 12
Registered: January 2007
Promising Member
I will give you more details. As I mentioned before everything is in folder c:/xmlsoft_distro

In project manager (I used configuration STUDENT_VER, just for fun) I added


Compiler options

1. WHEN STUDENT_VER : -Ic:/xmlsoft_distro/include

Libraries

2. WHEN STUDENT_VER : C:/xmlsoft_distro/lib/libxml2.lib C:/xmlsoft_distro/lib/zlib.lib C:/xmlsoft_distro/lib/iconv.lib


The output is

----- TestXML ( MT STUDENT_VER MAIN GCC DEBUG SO SHARED DEBUG_FULL WIN32 )
cd c:\MyApps\TestXML
TestXML.cpp
mingw32-g++ -c -I"c:\MyApps" -I"C:\mingw\include" -DflagMT -DflagSTUDENT_VER -DflagMAIN -DflagGCC -DflagDEBU
G -DflagSO -DflagSHARED -DflagDEBUG_FULL -DflagWIN32 -DbmYEAR=2007 -DbmMONTH=1 -DbmDAY=31 -DbmHOUR=10 -Db
mMINUTE=48 -DbmSECOND=10 -mthreads -g2 -shared -fPIC -Ic:/xmlsoft_distro/include -fexceptions -D_DEBUG -
O0 -fuse-cxa-atexit -x c++ "c:\MyApps\TestXML\TestXML.cpp" -o "C:/MyApps/out/TestXML/MINGW.Debug_full.Mai
n.Mt.Noblitz.Shared.So.Student_ver\TestXML.o"
c:\MyApps\TestXML\TestXML.cpp:1: warning: -fPIC ignored for target (all code is position independent)
C:\mingw\bin\mingw32-g++.exe -c -I"c:\MyApps" -I"C:\mingw\include" -DflagMT -DflagSTUDENT_VER -DflagMAIN -Df
lagGCC -DflagDEBUG -DflagSO -DflagSHARED -DflagDEBUG_FULL -DflagWIN32 -DbmYEAR=2007 -DbmMONTH=1 -DbmDAY=3
1 -DbmHOUR=10 -DbmMINUTE=48 -DbmSECOND=10 -mthreads -g2 -shared -fPIC -Ic:/xmlsoft_distro/include -fexcep
tions -D_DEBUG -O0 -fuse-cxa-atexit -x c++ "c:\MyApps\TestXML\TestXML.cpp" -o "C:/MyApps/out/TestXML/MIN
GW.Debug_full.Main.Mt.Noblitz.Shared.So.Student_ver\TestXML. o "
compiled in (0:03.13)
TestXML: 1 file(s) built in (0:02.99), 2994 msecs / file, duration = 3294 msecs
Linking...
mingw32-g++ -mwindows -mconsole -o " C:\MyApps\out\MINGW.Debug_full.Mt.Noblitz.Shared.So.Student_ ver\TestXML.e
xe" -ggdb -L"C:\mingw\lib" -Wl,-O,2 " C:/MyApps/out/TestXML/MINGW.Debug_full.Main.Mt.Noblitz.Share d.So.St
udent_ver\TestXML.o" -Wl,--start-group -lC:/xmlsoft_distro/lib/libxml2.lib -lC:/xmlsoft_distro/lib/zlib.
lib -lC:/xmlsoft_distro/lib/iconv.lib -Wl,--end-group
C:\mingw\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\mingw32\bi n\ld.exe: cannot find -lC:/xmlsoft_distro/lib/lib
xml2.lib
collect2: ld returned 1 exit status
C:\mingw\bin\mingw32-g++.exe -mwindows -mconsole -o "C:\MyApps\out\MINGW.Debug_full.Mt.Noblitz.Shared.So.Stud
ent_ver\TestXML.exe" -ggdb -L"C:\mingw\lib" -Wl,-O,2 "C:/MyApps/out/TestXML/MINGW.Debug_full.Main.Mt.Nob
litz.Shared.So.Student_ver\TestXML.o" -Wl,--start-group -lC:/xmlsoft_distro/lib/libxml2.lib -lC:/xmlsoft
_distro/lib/zlib.lib -lC:/xmlsoft_distro/lib/iconv.lib -Wl,--end-group
Error executing C:\mingw\bin\mingw32-g++.exe -mwindows -mconsole -o "C:\MyApps\out\MINGW.Debug_full.Mt.Noblit
z.Shared.So.Student_ver\TestXML.exe" -ggdb -L"C:\mingw\lib" -Wl,-O,2 "C:/MyApps/out/TestXML/MINGW.Debug_
full.Main.Mt.Noblitz.Shared.So.Student_ver\TestXML.o" -Wl,--start-group -lC:/xmlsoft_distro/lib/libxml2.
lib -lC:/xmlsoft_distro/lib/zlib.lib -lC:/xmlsoft_distro/lib/iconv.lib -Wl,--end-group
Exitcode: 1

There were errors. (0:04.20)


I used the simplified example to indicate my possible reason for the error
Re: Possible bug [message #7923 is a reply to message #7909] Wed, 31 January 2007 14:50 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
The commandline seems correct to me.

HOWEVER, the problem is that ".lib" is not usual extension for mingw. My guess is that these are MS VC++ libraries, incompatible with mingw.

Mirek
Re: Possible bug [message #7938 is a reply to message #7923] Thu, 01 February 2007 09:22 Go to previous messageGo to next message
fithisux is currently offline  fithisux
Messages: 12
Registered: January 2007
Promising Member
Hi again,

in my first report I show that this is not a problem with .lib. If you put TestXML.o after -o TestXML.exe it compiles and links and runs happily even though .lib are MSVC libraries. You can read at http://www.mingw.org/mingwfaq.shtml#faq-msvcdll . They have implemented support for .lib . I have linked to it. I cannot understand if this is a bug in the realm of Ultimate++ or MINGW.

Have you made a test with the information in the first report? I yes you will see I am right.

I think many people need to link to .libs on windows. For example mingw does not compile opencv (no suitable project yet, though Ultimate++ can help here). Ultimate++ provides a viable alternative to VStudio.

Do I have to make the modifications to the source code myself or is there someone who takes care of it?
Re: Possible bug [message #7957 is a reply to message #7938] Thu, 01 February 2007 19:02 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Do you think you could zip your test package and post it here to boost our fixing efforts a little? Smile

("Always include compilable testcase").

Mirek
Re: Possible bug [message #7984 is a reply to message #7957] Fri, 02 February 2007 15:57 Go to previous messageGo to next message
fithisux is currently offline  fithisux
Messages: 12
Registered: January 2007
Promising Member
In order to help you, this is my assembly with package MyApps. In TestXML folder there is the batch file (vasilis.bat) I used to link the TestXML.o in the out folder. You need a working mingw and you need to unzip all the binaries form ftp://ftp.zlatkovic.com/pub/libxml/ into c:\xmlsoft_distro to create a file hierarchy with bin/lib/ .... blah blah blah.

Then you are ready to go. If you need more, just tell me.

Vasilis Anagnostopoulos
  • Attachment: MyApps.7z
    (Size: 17.19KB, Downloaded 279 times)
Re: Possible bug [message #8008 is a reply to message #7854] Sat, 03 February 2007 22:53 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
OK, it was that .lib extension after all... now fixed. Quick fix:

ide/Builders/GccBuilder.cpp 423

if(ext == ".a" || ext == ".so" || ext == ".dll" || ext == ".lib")

[Updated on: Sat, 03 February 2007 22:53]

Report message to a moderator

Re: Possible bug [message #8009 is a reply to message #7854] Sat, 03 February 2007 23:46 Go to previous messageGo to next message
fithisux is currently offline  fithisux
Messages: 12
Registered: January 2007
Promising Member
Thank you luzr,

thank you from the bottom of my heart.
Re: Possible bug [message #8011 is a reply to message #8009] Sun, 04 February 2007 07:39 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
P.S.: For testcase, usually (and in this case too) all is needed is to pack single package directory - not MyApps and out folder, just TextXML....
Previous Topic: Bug (?) in ide\Debuggers\Exp.cpp
Next Topic: beta3 <new package> double lists templates
Goto Forum:
  


Current Time: Fri Apr 26 07:45:22 CEST 2024

Total time taken to generate the page: 0.03417 seconds