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++ Library support » U++ Libraries and TheIDE: i18n, Unicode and Internationalization » umk to generate .o file
umk to generate .o file [message #41862] Fri, 31 January 2014 15:32 Go to next message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
Hello!

I would like to create a .o file alone with umk (with MinGW in Windows).

Do you know how to do it?


Best regards
Iñaki
Re: umk to generate .o file [message #41866 is a reply to message #41862] Sat, 01 February 2014 10:39 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
This is a trick: Maybe doing a dummy executable that uses that compiles that .o, and copying it after compiling?

Best regards
Iñaki
icon5.gif  Re: umk to generate .o file [message #41867 is a reply to message #41866] Sat, 01 February 2014 22:34 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
Hello!

Trick done:
1. Compile dummy project
2. Get .a files. Add a "lib" to the names beginning so Core.a is libCore.a and so on
3. Include the .a files in gcc command, so it is added "-lz -lCore -lWeb"

4. However, gcc complains:
C:/MyProject/lib/libCore.a(z.o):z.cpp:(.text$_ZN3Upp4Zlib4FreeEv+0x14): undefined reference to `inflateEnd'
C:/MyProject/lib/libCore.a(z.o):z.cpp:(.text$_ZN3Upp4Zlib4FreeEv+0x22): undefined reference to `deflateEnd'
...

inflateEnd, deflateEnd and others are defined in z package, deflate.c file.

What could be the problem?


Best regards
Iñaki

[Updated on: Sat, 01 February 2014 22:34]

Report message to a moderator

Re: umk to generate .o file [message #41868 is a reply to message #41867] Sat, 01 February 2014 22:42 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
Solved!

Just changing the order in gcc command to -lCore -lz -lWeb.

This way, gcc can compile a non U++ project that uses U++ Smile Smile

For sure somebody knows how to do it better. If yes please post your way to do it.


Best regards
Iñaki
Re: umk to generate .o file [message #41869 is a reply to message #41868] Sun, 02 February 2014 00:02 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Hi Koldo

I don't know what you're trying to achieve, but I can give you two simplyfiing tips Wink

1) You can skip the renaming if you use the name of the static lib instead instead of -l option. E.g.: instead of -lCore just write Core.a. If that doesn't work, you might need to add path...

2) Determining correct order in which the libs must be entered on the command line can be hard (or impossible, if there is cyclic dependency:) ). You can use startgroup/endgroup linker options to make gcc work with libs in any order:
gcc -Wl,--startgroup z.a Core.a Web.a -Wl,--endgroup


If all you need to do is to mix U++ and non-U++ code, I can recommend you to use the universal makefile to take care of the U++ part (unless you need it on Windows). It is capable of compiling separate files or packages...

Best regards,
Honza
Re: umk to generate .o file [message #41870 is a reply to message #41869] Sun, 02 February 2014 08:45 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
Hello Honza

In this case the mix is:
- The main() is inside a non U++ .cpp file
- Other non U++ .cpp and .o files have to be linked
- Some of these .cpp files call U++ libs

Is it possible to use umk in this case?


Best regards
Iñaki
Re: umk to generate .o file [message #41871 is a reply to message #41870] Sun, 02 February 2014 11:02 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

koldo wrote on Sun, 02 February 2014 08:45

Hello Honza

In this case the mix is:
- The main() is inside a non U++ .cpp file
- Other non U++ .cpp and .o files have to be linked
- Some of these .cpp files call U++ libs

Is it possible to use umk in this case?

I don't see any reason why it would be a problem. The only obstacle is that you'd have to provide .upp file. You could do this in theide or manually. Just create main package containing all the non-U++ code and make it depend on the U++ packages it uses. Both umk and theide don't really care if the code is U++ or not.

Of course if the non-U++ part already uses some build system, this could mean duplicating some work. In that case, it might (or might not) be better to try to incorporate it into the other build system using the dummy project approach that you described above...

Honza
Re: umk to generate .o file [message #41879 is a reply to message #41871] Mon, 03 February 2014 11:21 Go to previous message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
Hello Honza

Quote:

I don't see any reason why it would be a problem. The only obstacle is that you'd have to provide .upp file. You could do this in theide or manually. Just create main package containing all the non-U++ code and make it depend on the U++ packages it uses. Both umk and theide don't really care if the code is U++ or not.
You are right. I will generate the .upp file automatically and call umk with it. Thank you Smile.


Best regards
Iñaki
Previous Topic: FileSel modification for translation
Next Topic: Fixed some Chinese translation in Core.t
Goto Forum:
  


Current Time: Fri Mar 29 12:27:39 CET 2024

Total time taken to generate the page: 0.01181 seconds