|
|
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 |
|
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 #41867 is a reply to message #41866] |
Sat, 01 February 2014 22:34 |
|
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 #41869 is a reply to message #41868] |
Sun, 02 February 2014 00:02 |
|
Hi Koldo
I don't know what you're trying to achieve, but I can give you two simplyfiing tips
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 #41871 is a reply to message #41870] |
Sun, 02 February 2014 11:02 |
|
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
|
|
|
|
Goto Forum:
Current Time: Fri Mar 29 12:27:39 CET 2024
Total time taken to generate the page: 0.01181 seconds
|
|
|