OS/2, eCS & ArcaOS - Technical > Programming

[Qt ports] Can't understand linking problem (-Zexe / -Zomf)

<< < (2/2)

Dave Yeo:
Hi Mentore,

--- Quote ---The program compiles but doesn't link. If I use -Zomf, the prelinker stops reporting a bunch of undetermined references, while using -Zexe it's g++ (ld) which stops saying it doesn't recognize the -O option. Needless to say, but there's no '-O' option in linker switches.

--- End quote ---

The rule is that you need to link with -Zomf to pull in OMF libraries which usually have a .lib suffix. With kLIBC -Zomf will also pull in aout libraries (.a suffix). As QT is an OMF build you will always need to at least add -Zomf to LDFLAGS.
-Zexe is hardly ever useful now a days and was introduced for those cases where a *nix makefile targets foo instead of foo.exe. It's better to add $(exeext) to the makefile if needed but most build systems can figure this out due to Windows also needing it. Using -Zomf also seems to create a correct executable with the .exe extension.
The error about -O is part of the command that GCC creates to call LD.

Mentore:

--- Quote from: Dave Yeo on June 20, 2015, 03:44:32 am ---Hi Mentore,

--- Quote ---The program compiles but doesn't link. If I use -Zomf, the prelinker stops reporting a bunch of undetermined references, while using -Zexe it's g++ (ld) which stops saying it doesn't recognize the -O option. Needless to say, but there's no '-O' option in linker switches.

--- End quote ---

The rule is that you need to link with -Zomf to pull in OMF libraries which usually have a .lib suffix. With kLIBC -Zomf will also pull in aout libraries (.a suffix). As QT is an OMF build you will always need to at least add -Zomf to LDFLAGS.
-Zexe is hardly ever useful now a days and was introduced for those cases where a *nix makefile targets foo instead of foo.exe. It's better to add $(exeext) to the makefile if needed but most build systems can figure this out due to Windows also needing it. Using -Zomf also seems to create a correct executable with the .exe extension.
The error about -O is part of the command that GCC creates to call LD.

--- End quote ---

Thanks Dave and all of you. As said before, the problem was solved reworking the .pro file to include all the JSON files. Socializer works a little bad so I consider it a "no-way", but still this confirms I can build Qt GUI programs. By the way, yesterday evening I was able to compile cpik (PIC microcontroller programming software under Qt) which is a VIO software, so it seems everything works fine.

Mentore

Navigation

[0] Message Index

[*] Previous page

Go to full version