Qucs / qucs

Qucs Project official mirror
http://qucs.sourceforge.net/
GNU General Public License v2.0
1.15k stars 213 forks source link

Qucs on Windows cannot find simulation script #68

Closed yodalee closed 10 years ago

yodalee commented 10 years ago

I just build a windows version to test issue #28 , however I ran into another problem using the full _adder.sch. https://gist.github.com/guitorri/19d27ae05dda70fd0163 Qucs cannot found simulation script, that is qucsdigi.bat, when starting simulation.


The problem is in dialogs/simmessage.cpp in the function pathName(), it return a empty string. Here is the code and message I get in pathName(); print code:

  const char * lpath = QDir::toNativeSeparators(longpath).ascii();
  char spath[2048];
  int len = GetShortPathNameA(lpath,spath,sizeof(spath)-1);
  spath[len] = '\0';
  qDebug("pathName");
  qDebug() << "longPath: " << longpath;
  qDebug() << "Dir result " << QDir::toNativeSeparators(longpath);
  qDebug() << "lpath: " << lpath;
  qDebug() << "spath: " << spath;
  qDebug() << "len: " << len;

and here is the result:

Debug: pathName
Debug: longPath:  "c:qucs-auto/bin/qucsdigi.bat" 
Debug: Dir result  "c:qucs-auto\bin\qucsdigi.bat" 
Debug: lpath:   qD 
Debug: spath:   
Debug: len:  0 

Why the lpath cannot print out is maybe the problem of qDebug(). The true problem is that spath become a empty string so that qucs cannot find correct qucsdigi script.

yodalee commented 10 years ago

My try and error result, the lpath should be something like: const char * lpath = "c:\\qucs-auto\\bin\\qucsdigi.bat" so that qucs will find qucsdigi script. So the environment parameter should be something like

QUCSDIR=C:\qucs-auto\bin

However this will cause an error in Qt library.

guitorri commented 10 years ago

Are you running on Windows or Wine? If I remember correctly the QUCSDIR should not have the bin part. What is the Qt error?

yodalee commented 10 years ago

Windows I set: export QUCSDIR=c:qucs-auto as the wiki suggests. The result is that variable Program will be an empty string. In simulation window, the simulation stop with output "Program not found: "

yodalee commented 10 years ago

If I try to set export QUCSDIR=c:\\qucs-auto then the program terminated with the window like following before the qucs main window show up: default and the message in gdb is: warning: invalid parameter passed to C runtime library

guitorri commented 10 years ago

This message is not helpful... I have to go thru the Windows build instructions... some thinks might have changed. Did you build also qucs-core ? Did you try to run a normal simulation? The qucsator should also be on the bin directory... How are you monitoring the qDebug() messages? I had to use the DebugView to intercept them...

yodalee commented 10 years ago

Do you meet the same issue like me? Just in case that if I did something wrong.


Yes I built qucs-core and qucsactor.exe is in c:qucs-auto/bin. Here is the bin directory contents: xd4


To monitor the qDebug(), there are two way. The more general way is that: Add CONFIG += console in .pro file, which is not applicable in our case since qucs don't use .pro and qmake. Temp solution, you can run qucs like this to get qDebug message:

qucs > log.txt 2>&1
guitorri commented 10 years ago

Which terminal is this? Are you running it natively on Windows? If not it might not work. I cannot run the .bat files in Wine for instance...

yodalee commented 10 years ago

I just show the files list result in Linux, which I use it most of the time. In windows(native) I use MinGW to build and run qucs.

guitorri commented 10 years ago

Note that on Windows a couple of environment variables need to be set by the various Inno installers. All these variables are set: QUCSDIR, HOME, ADMSXMLBINDIR, ASCOBINDIR, OCTAVEDIR, OCTAVEBINDIR, FREEHDL, MINGWDIR... I guess Icarus-Verilog also sets a few other variables.

Perhaps it is easier if you make a normal install from the distributed Qucs 0.0.18 Windows installer. After you get it working, reproduce the reported error, than compile your own on top of it. Configure it the prefix to overwrite and make install it on top...

yodalee commented 10 years ago

I see, I will try that.