-
Notifications
You must be signed in to change notification settings - Fork 215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Trying to build for windows #1038
Conversation
Thanks for your comments and patches.
On Thu, Feb 25, 2021 at 12:34:58AM -0800, Patarimi wrote:
I try to build qucs for windows using msys. The list below summaries what works.
- [x] autotools
- [x] man
- [x] src
- [x] qucs-lib
- [ ] tools
_lst_ variables detected as *int* by compiler. Rename lst in list and it builds.
Does no harm. merged.
- [x] translations
- [x] examples
- [ ] include
`../../include/output.h:153:3: error: 'axis' declared as a 'virtual' field`
function DataX from include/output.h need to be removed.
I think on your platform "axis" is a macro (?). The line is staged for
removal anyway but removing it breaks compilation in another place. I
need to check.
- [ ] main
build successful, in debug crash with the following message `assertion failed` in main/main.cpp: line 190
the line.png file is not find.
The line.png line is a sanity check, I don't know exactly where QFile is
looking for things, but you won't see any icons if this does not work. I
wouldn't mind to drop the "resource files" for some more sensible
approach...
- [ ] cli
`../../cli/main.cpp:69:3: error: 'sigjmp_buf' does not name a type; did you mean 'jmp_buf'?`
This should be handled by platform.h. maybe I broke it. maybe it has to
do with SIGSETJMP_IS_BROKEN. see line 138. try -DSIGSETJMP_IS_BROKEN.
- [ ] contrib
note : need to include qcustomplot.h et qcustomplot.cpp in msys64\mingw64\include (to be added in the appveyor.yml script ?)
This plugin is optional. install qcustomplot headers, or just skip it.
(there will be changes to how plugins will be built, better dont waste
your time on configure.ac)
`/bin/sh ../../libtool --tag=CXX --mode=link g++ -g -O2 -g -O0 -pipe -fno-check-new -W -Wall -std=c++14 -O0 -fPIC -fPIC -g -O2 -g -O0 -pipe -fno-check-new -W -Wall -std=c++14 -O0 -shared -module -avoid-version -mwindows -o vadim.la -rpath /c/qucs-win64/lib/qucs//contrib/vadim/.. vadim_la-DIODE_SPICE.lo
libtool: error: can't build x86_64-w64-mingw32 shared library unless -no-undefined is specified`
Do you see this for all plugins? you need to link them against libqucs
(on some non-POSIX platforms.). plugins should be linked against
QUCS_LIBS (e.g. through qucs-conf, but currently autotools...), it needs
to be set accordingly. Perhaps you also need to link qt libraries,
sometimes but not sure.
- [x] tests
- [ ] legacy
`test -L _ || cp -pR .libs/action.so _
cp: cannot stat '.libs/action.so': No such file or directory`
strange. will have a look.
|
Thanks a lot for your responses. It was very helpfull. Every things compile now !
The program still crash after anyway, but all the .png are missing. Maybe there is a problem in the src folder ?
Fix with -DSIGSETJMP_IS_BROKEN.
I add -no-undefined in LD_FLAGS variable and it fix it. It seems to be mandatory when the -shared flag is used.
This error disappeared. |
On Fri, Feb 26, 2021 at 12:14:35AM -0800, Patarimi wrote:
Thanks a lot for your responses. It was very helpfull. Every things compile now !
Thanks for your feedback. Please rebase now and then -- I tend to fix
things one by one, sometimes in a different way.
The program still crash after anyway, but all the .png are missing. Maybe there is a problem in the src folder ?
I simply don't know. It does not happen here.
Fix with -DSIGSETJMP_IS_BROKEN.
see platform.h
I add -no-undefined in LD_FLAGS variable and it fix it. It seems to be mandatory when the -shared flag is used.
It must not be hard coded. Find a way to make it optional. Ideas
- look at common.mk
- look at qucs-conf
- introduce EXTRA_PLUGIN_LD_FLAGS (?) and build with
$ make EXTRA_PLUGIN_LD_FLAGS=-no-undefined
Same issue with additional libraries. This might as well require changes
to MakeLists... only MakeList contents and qucs-conf will inform
compilation later on. (Will get back to this.)
|
On Wed, Mar 03, 2021 at 12:06:09AM -0800, Patarimi wrote:
I think I fix the issue with the missing file (see
[6212ba6](6212ba6)).
Good, this is where it is looking for the bitmaps. It solves the issue
half-way... the programs are supposed to run without the need for
installation (alias "make install".) In particular the tests will still
fail after this "fix". There is more to it.
For the lib_LD_FLAGS, want do you mean by hard-coded ? For example, is
the fix in
[0ae75e2](0ae75e2)
correct ?
Never thought about it, but -no-undefined is probably wrong in general.
What does it do exactly?
hidpi_la_LIBADD = $(X11_LIBS) $(QT_LIBS)
This may be needed on non-POSIX, but it is wrong in general and it has
side effects.
The program still don't start perhaps because the qucsator program is not accessible.
Do you have an error message? qucsator is not needed for sure.
|
According to the documentation :
This is probably specific to windows. This may also explain why the declaration below is mandatory.
When run from a terminal, it output the following:
|
On Wed, Mar 03, 2021 at 05:41:55AM -0800, Patarimi wrote:
When run from a terminal, it output the following:
```
incomplete:../../src/settings.cpp:14:tQucsSettings
error 3 bad internal command: attach
"attach" is in src/attach.cc it can't be not there... The dispatcher
stuff was added years ago, when CI was still working. I have never seen
this on non-POSIX since, something stupid must be going on...
If you can't figure it out, please send the configure & build logs and
the full output, just in case. cross fingers.
thanks
|
I have not found the solution yet. I'll try to look for it tomorrow. |
On Wed, Mar 03, 2021 at 08:37:57AM -0800, Patarimi wrote:
I have not found the solution yet. I'll try to look for it tomorrow.
Here are the config.log and the make output:
[make.log](https://github.com/Qucs/qucs/files/6077546/make.log)
[config.log](https://github.com/Qucs/qucs/files/6077548/config.log)
this is what I found.
../../include/e_base.h:29: warning: "INTERFACE" redefined
29 | #define INTERFACE
All such definitions must be in platform.h (this is for me to fix.) I
don't really know what it does (not needed on POSIX), but it might be
worth checking in the long run.
redefinition of FALSE, also for me to fix.
/bin/sh ../libtool --tag=CXX --mode=link g++ -g -O2 -pipe -fno-check-new -std=c++14 -fPIC -g -O2 -pipe -fno-check-new -std=c++14 -mwindows -o libqucs.la [..]
[..] libtool: warning: undefined symbols not allowed in x86_64-w64-mingw32 shared libraries;
[..] building static only [..]
I don't know if static builds will work. They introduce problems, e.g.
[1]. I suggest to dig into the the libtool warning. static builds are
for platforms without a dynamic loader (rare).
libtool: error: can't build x86_64-w64-mingw32 shared library unless -no-undefined is specified make[3]:
*** [Makefile:501: hidpi.la] Error 1
hidpi.la is not mission critical, still you need to extend LDFLAGS and
LDADD in a few more more places. (The build is not complete, so
something else might be missing.)
[1] https://stackoverflow.com/questions/1202494/why-doesnt-attribute-constructor-work-in-a-static-library
|
add EXTRA_DIST variable after the PNG and ICON declaration. specify the destination folder.
let's try it !
include platforme.h where needed
This reverts commit 15255e7.
I try to build qucs for windows using msys. The list below summaries what works.
build successful. However, in debug mode, it crashes with the following message
note : need to include qcustomplot.h et qcustomplot.cpp in msys64\mingw64\include (to be added in the appveyor.yml script ?)