Author Topic: Howto - Cross Compiling in Linux using MingW32  (Read 248456 times)

Offline keke

  • Single posting newcomer
  • *
  • Posts: 3
Re: Howto - Cross Compiling in Linux using MingW32
« Reply #60 on: January 05, 2009, 10:57:27 pm »
Thanks for the tutorial. Have to say it's one of the most useful ones on the internet (even more useful than the stupid mingw faq).
But what you left out is what you doing before step2? What's the binary of the gui configurator you using? You said you use ubuntu, I didn't find it.
Anyway I don't need it because I wrote my makefile manually.
It's the first time when I even try to use mingw and I use it for crosscompiling a C app for windows on linux. After couple of hours trying it compiled all the c codes to obj and linked them but the final binary is a junk and broken.
I'm sure there is some prob with the flags I using. Please POST YOUR MAKEFILES, ALL OF YOU!
I need other good examples.

<pre>
OBJECTS = $(C_SRC:%.c=%.o)


# How to make a C file

%.o: %.c
        $(CC) $(CFLAGS) $(DEFINES) $(INCLUDE_PATHS) -o $@ -c $<

##
## TARGET DEFINITIONS
##

.PHONY: all clean

all: $(TARGET)

install:


##
## BUILD
##

$(TARGET): $(OBJECTS)
        $(CC) $(OBJECTS) $(LIB_PATHS) $(LIBS) -o $(TARGET)
</pre>

Also since I never heard of this gui configurator thingy you using I just copied the libs like kernel32.lib out from my SDK install in windows to my appdir (maybe I shouldnt?)

Offline defcronyke

  • Single posting newcomer
  • *
  • Posts: 4
Re: Howto - Cross Compiling in Linux using MingW32
« Reply #61 on: August 03, 2009, 06:19:16 am »
Step 14:

When I reached this step, compiled and tried to run my application I realized that for some reason codeblocks was trying to execute my .exe through /usr/bin/wine-auto (which I do not have)... So I created a simlink to wine:
Code: [Select]
# sudo ln -s /usr/bin/wine /usr/bin/wine-auto

Hi, I have code::blocks set up on debian to compile for win32 using MinGW just fine after following the tutorial in this thread, I have the debugger running just fine, however, I would really like to know where I can change the IDE settings to automatically run the resulting .exe file with wine when I select "Build and Run" (F9). I already had the /usr/bin/wine-auto file, but just to be sure, i removed it and symlinked /usr/bin/wine to /usr/bin/wine-auto, and it is not running the .exe with either of them. This is my build log:

Checking for existence: /home/bakeonandham/src/wxhelloworld2/bin/WinRelease/wxhelloworld2.exe
Executing: /home/bakeonandham/src/wxhelloworld2/bin/WinRelease/wxhelloworld2.exe  (in /home/bakeonandham/src/wxhelloworld2/.)
Process terminated with status 1 (0 minutes, 5 seconds)

I have looked through all the settings menus and I can't figure out what to change to make the .exe execute with wine. I have searched google and the code::blocks wiki, as well as these forums, and cannot find an answer, as apparently, it is just supposed to work. I started with a fresh install of the IDE and followed this tutorial exactly, and everything else works fine.

**EDIT**
Sorry for wasting everyone's time, I found the solution to my question right after I posted this. In case anyone else is wondering, here's how I made my .exe open with wine when I press (F9):

1. Open project
2. Select Project menu -> Build options
3. Click WinRelease (or whatever the win32 build target is called)
4. Select Pre/post build steps tab
5. In Post-build steps enter: /usr/bin/wine ${TARGET_OUTPUT_FILE}
6. Check the "Always execute, even if target is up-to-date" box
7. Click Ok
« Last Edit: August 03, 2009, 06:52:59 am by defcronyke »

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7159
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: Howto - Cross Compiling in Linux using MingW32
« Reply #62 on: August 03, 2009, 10:59:40 am »
**EDIT**
Sorry for wasting everyone's time, I found the solution to my question right after I posted this. In case anyone else is wondering, here's how I made my .exe open with wine when I press (F9):

1. Open project
2. Select Project menu -> Build options
3. Click WinRelease (or whatever the win32 build target is called)
4. Select Pre/post build steps tab
5. In Post-build steps enter: /usr/bin/wine ${TARGET_OUTPUT_FILE}
6. Check the "Always execute, even if target is up-to-date" box
7. Click Ok

In this case it will always run (after every build) and not only if you press F9.
Your OS (linux) has to know what it shall do with windows-executables.
You may find this wiki-article of interest :http://wiki.codeblocks.org/index.php?title=Cross_Compiling_wxWidgets_Applications_on_Linux#Normal_run

Nevertheless this does not always work.
You can also use the tool menu to run the windows-exe:
I use the following settings:
  • Name: wine starten
  • Executable: /usr/bin/wine
  • Parameters: ${TARGET_OUTPUT_FILE}
  • Working directory: ${PROJECT_DIR}

With the keybinder-plugin, you can set a shortcut to the new menu-entry in the tools menus and you are done.

Offline defcronyke

  • Single posting newcomer
  • *
  • Posts: 4
Re: Howto - Cross Compiling in Linux using MingW32
« Reply #63 on: August 03, 2009, 09:44:11 pm »
Thanks for the tip. I figured out the way to create an "open with wine" tool also, but I wanted to have the same functionality/behavior for Win32 target as for a Linux target. Surprisingly, I already had the binfmt-support package installed and my code::blocks was not opening with wine or wine-auto. I'm using Debian Squeeze by the way. Maybe a bug? Or maybe I need to set up the binfmt-support package in some special way. It's not really important to me though, as the post-build action is sufficient for my needs.

Now if I could just figure out how to build win32 files from a Linux amd64 machine... I don't expect an answer for that here though. :P

Offline wilbefast

  • Multiple posting newcomer
  • *
  • Posts: 16
Re: Howto - Cross Compiling in Linux using MingW32
« Reply #64 on: October 06, 2009, 06:09:16 pm »
Is the first page still up-to-date? 2006 seems a bit far back, and no "insight" to be found (the link doesn't work)  :?

Just thought I'd ask before breaking something.


William

Offline defcronyke

  • Single posting newcomer
  • *
  • Posts: 4
Re: Howto - Cross Compiling in Linux using MingW32
« Reply #65 on: October 09, 2009, 09:12:18 pm »
I have the debugger running just fine...

I shouldn't have said this, as I hadn't really tested debugging. I am actually having a problem with the debugger (windows version of GNU gdb 5.2.1 in wine wrapper script).

The Debugger starts fine but doesn't allow me to step through the program. Sometimes the output says "No symbol table is loaded.  Use the "file" command." While other times, it says "The program is not being run". I have selected the "Produce debugging symbols [-g]" option in my build target options...

Any ideas on how to debug a win32 target?

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7159
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: Howto - Cross Compiling in Linux using MingW32
« Reply #66 on: October 09, 2009, 10:09:02 pm »
Any ideas on how to debug a win32 target?

Read my comments about cross-debugging:
http://wiki.codeblocks.org/index.php?title=Cross_Compiling_wxWidgets_Applications_on_Linux#Debugging


By the way:
gdb 5.2.1 does not even work correctly if you do not use it as cross-platform debugger, because it's a little bit outdated.

Offline defcronyke

  • Single posting newcomer
  • *
  • Posts: 4
Re: Howto - Cross Compiling in Linux using MingW32
« Reply #67 on: October 10, 2009, 10:43:11 pm »
Thanks for the tip. I tried gdb v7.0 and it works great!

Offline Green::horn

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: Howto - Cross Compiling in Linux using MingW32
« Reply #68 on: November 10, 2009, 12:25:13 am »
Is the first page still up-to-date? 2006 seems a bit far back, and no "insight" to be found (the link doesn't work)  :?

Just thought I'd ask before breaking something.


William
Hi,

you can find and download the "insight.exe" from here:
http://sourceforge.net/projects/mingw/files/User%20Contributed/insight/


Greenhorn

Offline kencamargo

  • Multiple posting newcomer
  • *
  • Posts: 110
Re: Howto - Cross Compiling in Linux using MingW32
« Reply #69 on: January 31, 2010, 11:22:54 pm »
Thanks for the tip. I tried gdb v7.0 and it works great!

No matter what version of the debugger I try, I get errors and no debugging (either it aborts or I get a segfault). I am using a 64 bit version of Ubuntu, might this be getting in the way?

Thans in advance,
Ken

Offline milope

  • Single posting newcomer
  • *
  • Posts: 5
Re: Howto - Cross Compiling in Linux using MingW32
« Reply #70 on: February 04, 2010, 10:21:30 am »
You can not use the same library for linux and windows builds.
the linux libs are under "/usr/lib[32|64]/" or "/usr/local/lib[32|64]", the windows libs under "/usr/i586-mingw32msvc/lib".

That a library is a cross-platform only means that the sources can be compiled on different platforms, the binaries are different.
Helo guys,

Same problem : I need to use libxml2 in  a cross project .
 - I tried lots of manips like to put libxml2 win32 on mingw directory  (it give /usr/i586-mingw32msvc/lib/libxml2_a.lib  and /usr/i586-mingw32msvc/include/libxml/lots-of-.h-files ) but nothing work...

Any body can help me ?

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9415
Re: Howto - Cross Compiling in Linux using MingW32
« Reply #71 on: February 04, 2010, 12:25:36 pm »
Any body can help me ?
What about adding it to the libraries to link against and providing the path to the lib to the linker directories in the project (target) settings?

However, without a full compiler log of the actual error you won't get much help.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline rcoll

  • Almost regular
  • **
  • Posts: 150
Re: Howto - Cross Compiling in Linux using MingW32
« Reply #72 on: February 04, 2010, 02:13:51 pm »
You can not use the same library for linux and windows builds.
the linux libs are under "/usr/lib[32|64]/" or "/usr/local/lib[32|64]", the windows libs under "/usr/i586-mingw32msvc/lib".

That a library is a cross-platform only means that the sources can be compiled on different platforms, the binaries are different.
Helo guys,

Same problem : I need to use libxml2 in  a cross project .
 - I tried lots of manips like to put libxml2 win32 on mingw directory  (it give /usr/i586-mingw32msvc/lib/libxml2_a.lib  and /usr/i586-mingw32msvc/include/libxml/lots-of-.h-files ) but nothing work...

Any body can help me ?

You are not clear -- are you trying to use the same binary library on both systems (linux and windows)?
If so, that will not work.

Ringo

Offline milope

  • Single posting newcomer
  • *
  • Posts: 5
Re: Howto - Cross Compiling in Linux using MingW32
« Reply #73 on: February 04, 2010, 02:44:05 pm »
->MortenMacFly
Sorry, this is build log :
Code: [Select]
obj/Release/main.o:/home/equipement/dev/test_libxml2/main.cpp|66|first defined here|
obj/Release/main.o:/home/equipement/dev/test_libxml2/main.cpp|89|first defined here|
obj/Release/main.o:/home/equipement/dev/test_libxml2/main.cpp|53|first defined here|
obj/Release/main.o:/home/equipement/dev/test_libxml2/main.cpp|34|first defined here|
obj/Release/main.o:/home/equipement/dev/test_libxml2/main.cpp|34|first defined here|
obj/Release/main.o:/home/equipement/dev/test_libxml2/main.cpp|34|first defined here|
obj/Release/main.o:/home/equipement/dev/test_libxml2/main.cpp|34|first defined here|
obj/Release/main.o:/home/equipement/dev/test_libxml2/main.cpp|30|first defined here|
obj/Release/main.o:/home/equipement/dev/test_libxml2/main.cpp|30|first defined here|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/xmlIO.obj):../xmlIO.c:(.data+0xec)||undefined reference to `_gzopen'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/xmlIO.obj):../xmlIO.c:(.text[_xmlWrapGzOpenUtf8]+0xf)||undefined reference to `_gzopen'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/xmlIO.obj):../xmlIO.c:(.text[_xmlWrapGzOpenUtf8]+0x6b)||undefined reference to `_gzdopen'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/xmlIO.obj):../xmlIO.c:(.text[_xmlInitPlatformSpecificIo]+0x75)||undefined reference to `_gzopen'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/xmlIO.obj):../xmlIO.c:(.text[_xmlGzfileOpen_real]+0x25)||undefined reference to `_gzdopen'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/xmlIO.obj):../xmlIO.c:(.text[_xmlGzfileOpenW]+0x42)||undefined reference to `_gzdopen'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/xmlIO.obj):../xmlIO.c:(.text[_xmlGzfileRead]+0x11)||undefined reference to `_gzread'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/xmlIO.obj):../xmlIO.c:(.text[_xmlGzfileWrite]+0x11)||undefined reference to `_gzwrite'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/xmlIO.obj):../xmlIO.c:(.text[_xmlGzfileClose]+0x7)||undefined reference to `_gzclose'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/xmlIO.obj):../xmlIO.c:(.text[_xmlFreeZMemBuff]+0x13)||undefined reference to `_deflateEnd'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/xmlIO.obj):../xmlIO.c:(.text[_xmlCreateZMemBuff]+0xa8)||undefined reference to `_deflateInit2_'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/xmlIO.obj):../xmlIO.c:(.text[_xmlCreateZMemBuff]+0x102)||undefined reference to `_crc32'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/xmlIO.obj):../xmlIO.c:(.text[_xmlZMemBuffAppend]+0x52)||undefined reference to `_deflate'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/xmlIO.obj):../xmlIO.c:(.text[_xmlZMemBuffAppend]+0x6b)||undefined reference to `_crc32'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/xmlIO.obj):../xmlIO.c:(.text[_xmlZMemBuffGetContent]+0x34)||undefined reference to `_deflate'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/xmlIO.obj):../xmlIO.c:(.text[___xmlParserInputBufferCreateFilename]+0xbd)||undefined reference to `_gzread'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/xmlIO.obj):../xmlIO.c:(.text[___xmlParserInputBufferCreateFilename]+0xe1)||undefined reference to `_gzrewind'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/xmlIO.obj):../xmlIO.c:(.text[_xmlFreeHTTPWriteCtxt]+0x2d)||undefined reference to `_deflateEnd'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/encoding.obj):../encoding.c:(.text[_xmlIconvWrapper]+0x59)||undefined reference to `_libiconv'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/encoding.obj):../encoding.c:(.text[_xmlCharEncCloseFunc]+0x3f)||undefined reference to `_libiconv_close'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/encoding.obj):../encoding.c:(.text[_xmlCharEncCloseFunc]+0x5d)||undefined reference to `_libiconv_close'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/encoding.obj):../encoding.c:(.text[_xmlByteConsumed]+0x6)||undefined reference to `__chkstk'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/encoding.obj):../encoding.c:(.text[_xmlFindCharEncodingHandler]+0xd2)||undefined reference to `_libiconv_open'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/encoding.obj):../encoding.c:(.text[_xmlFindCharEncodingHandler]+0xdf)||undefined reference to `_libiconv_open'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/encoding.obj):../encoding.c:(.text[_xmlFindCharEncodingHandler]+0xf8)||undefined reference to `_libiconv_open'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/encoding.obj):../encoding.c:(.text[_xmlFindCharEncodingHandler]+0x111)||undefined reference to `_libiconv_open'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/encoding.obj):../encoding.c:(.text[_xmlFindCharEncodingHandler]+0x137)||undefined reference to `_libiconv_close'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/encoding.obj):../encoding.c:(.text[_xmlFindCharEncodingHandler]+0x13d)||undefined reference to `_libiconv_close'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/valid.obj):../valid.c:(.text[_xmlValidBuildContentModel]+0x6)||undefined reference to `__chkstk'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/valid.obj):../valid.c:(.text[_xmlValidateElementContent]+0x6)||undefined reference to `__chkstk'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/xpath.obj):../xpath.c:(.text[_xmlXPathFormatNumber]+0xa4)||undefined reference to `__ftol2'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/xpath.obj):../xpath.c:(.text[_xmlXPathFormatNumber]+0x1a4)||undefined reference to `__ftol2'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/xpath.obj):../xpath.c:(.text[_xmlXPathIsPositionalPredicate]+0x3c)||undefined reference to `__ftol2'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/xpath.obj):../xpath.c:(.text[_xmlXPathFloorFunction]+0x6a)||undefined reference to `__ftol2'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/xpath.obj):../xpath.c:(.text[_xmlXPathCeilingFunction]+0x6e)||undefined reference to `__ftol2'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/nanohttp.obj):../nanohttp.c:(.text[_xmlNanoHTTPFreeCtxt]+0xcb)||undefined reference to `_inflateEnd'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/nanohttp.obj):../nanohttp.c:(.text[_xmlNanoHTTPReadLine]+0x6)||undefined reference to `__chkstk'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/nanohttp.obj):../nanohttp.c:(.text[_xmlNanoHTTPScanAnswer]+0x449)||undefined reference to `_inflateInit2_'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/nanohttp.obj):../nanohttp.c:(.text[_xmlNanoHTTPRead]+0x97)||undefined reference to `_inflate'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/nanoftp.obj):../nanoftp.c:(.text[_xmlNanoFTPList]+0x6)||undefined reference to `__chkstk'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/nanoftp.obj):../nanoftp.c:(.text[_xmlNanoFTPGet]+0x6)||undefined reference to `__chkstk'|
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options...|
||=== Build finished: 50 errors, 36 warnings ===|

-> rcoll
My program work fine under linux, with gcc and distrib libxml2-2.7.5 package -> Ok
I also want to build a windows version, also under linux, using mingw and libxml2-2.7.6.win32 binaries (/usr/i586-mingw32msvc/lib/libxml2_a.lib  and /usr/i586-mingw32msvc/include/libxml/lots-of-.h-files ) -> there is the problem...

I'v also tried to compile libxml with mingw but not successfully...

-----Edit...
Execution is ok if I put libxml2.dll into the program folder without any libs or .h with libxml2_a.lib (witch is renamed libxml2.a) and includes files in /usr/i586-mingw32msvc/.
But I want only one static file ! Can you tell me how can I do this ?

Thanks !
« Last Edit: February 04, 2010, 03:27:20 pm by milope »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9415
Re: Howto - Cross Compiling in Linux using MingW32
« Reply #74 on: February 04, 2010, 08:21:44 pm »
But I want only one static file ! Can you tell me how can I do this ?
You'll most likely need to create the static lib from the sources, sorry.

BTW: you have a broken project setup. It seems you imported a Visual Studio project and didn't clear up the settings for MinGW. Or you are using a wrong version of the VC compiler. I could tell but unfortunately you did not post the full "build log" (see my sig how to enable this). I don't need to see the errors, but the full log (including the compiler / linker commands). Just right-click on the "Build log" tab, select "Copy contents to clipboard" and paste here. Again: Don't forget to enable the full compiler log first.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ