OS2 World Community Forum
OS/2, eCS & ArcaOS - Technical => Programming => Topic started by: Mentore on June 19, 2015, 06:49:18 pm
-
Hello all.
I'm getting back to porting Qt programs, but I'm having troubles in linking. Here's the scenario: I decided to port Socializer (facebook QT browser) to try and have a native facebook browser native.
Being a Qt 5 application, I solved the JSON problem with an alternative library - works.
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.
I also tried to
I attach here the makefile and the error messages reported. I'm currently using GCC 4.73, but the errors are the same. I even tried to delete all the -Z* linker options, and linking stops complaining it can't find the Qt libraries with errors like this:
U:/usr/i386-pc-os2-emx/bin/ld.exe: No such file or directory for QtGui4
or
U:/usr/i386-pc-os2-emx/bin/ld.exe: No such file or directory for QtWebKit4
but the library files (.lib files) are there. I'm really puzzled by this behavior. (Of course it's my ignorance on how gcc / ld work.)
-
Hello all.
I'm getting back to porting Qt programs, but I'm having troubles in linking. Here's the scenario: I decided to port Socializer (facebook QT browser) to try and have a native facebook browser native.
Being a Qt 5 application, I solved the JSON problem with an alternative library - works.
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.
I also tried to
I attach here the makefile and the error messages reported. I'm currently using GCC 4.73, but the errors are the same. I even tried to delete all the -Z* linker options, and linking stops complaining it can't find the Qt libraries with errors like this:
U:/usr/i386-pc-os2-emx/bin/ld.exe: No such file or directory for QtGui4
or
U:/usr/i386-pc-os2-emx/bin/ld.exe: No such file or directory for QtWebKit4
but the library files (.lib files) are there. I'm really puzzled by this behavior. (Of course it's my ignorance on how gcc / ld work.)
according to the error.txt it doesn't find the JSon stuff. did you add the library to link with -ljson.lib or such?
-
Hello all.
I'm getting back to porting Qt programs, but I'm having troubles in linking. Here's the scenario: I decided to port Socializer (facebook QT browser) to try and have a native facebook browser native.
Being a Qt 5 application, I solved the JSON problem with an alternative library - works.
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.
I also tried to
I attach here the makefile and the error messages reported. I'm currently using GCC 4.73, but the errors are the same. I even tried to delete all the -Z* linker options, and linking stops complaining it can't find the Qt libraries with errors like this:
U:/usr/i386-pc-os2-emx/bin/ld.exe: No such file or directory for QtGui4
or
U:/usr/i386-pc-os2-emx/bin/ld.exe: No such file or directory for QtWebKit4
but the library files (.lib files) are there. I'm really puzzled by this behavior. (Of course it's my ignorance on how gcc / ld work.)
according to the error.txt it doesn't find the JSon stuff. did you add the library to link with -ljson.lib or such?
I know it seems so, but still - the software package I used to allow the JSon functionalities does not contain a library. Indeed I have to investigate further this issue, but even the documentation does not talk about a library file.
EDIT: indeed I must have eaten my brains in a moment of hunger!!! :o I included the header and cpp files, but did not modify the .pro file to compile the .cpp files. I'm feeling such an idiot now...
I'm afraid I'm getting too used to fancy IDEs and similar. Ok, back to work. Thank you! I'll report my results eventually.
Mentore
-
EDIT: indeed I must have eaten my brains in a moment of hunger!!! :o I included the header and cpp files, but did not modify the .pro file to compile the .cpp files. I'm feeling such an idiot now...
I'm afraid I'm getting too used to fancy IDEs and similar. Ok, back to work. Thank you! I'll report my results eventually.
Mentore
Aaaaannnd... It worked! Socializer.exe is up and running. And it does quite an interesting job, though it seems unable to load images. Nevermind, it's still a nice step forward in creating new OS/2 software. This makes my evening :)
Mentore
-
Hi Mentore,
If you are looking for something to port maybe you could look at Sigil an epub production tool/editor. As far as I know the last version that used Qt4 was v0.6.2 (I got the source code in case it was deleted as being too old).
-
Hi Mentore,
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.
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.
-
Hi Mentore,
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.
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.
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