jxjo / Xoptfoil-JX

Xoptfoil-JX - modified version
GNU General Public License v3.0
14 stars 5 forks source link

undefined reference / LINUX compilation #15

Closed joyo44 closed 4 years ago

joyo44 commented 4 years ago

Hi Jochen, i cloned the repository and tried to compile under Linux. Failed with some undefined references:

CMakeFiles/MYOBJLIB.dir/src/fortran/os_util.f90.o: In function __os_util_MOD_print_colored_windows': os_util.f90:(.text+0x5d): undefined reference toGetStdHandle' os_util.f90:(.text+0x6b): undefined reference to GetConsoleScreenBufferInfo' os_util.f90:(.text+0x7a): undefined reference toSetConsoleTextAttribute' os_util.f90:(.text+0xfc): undefined reference to `SetConsoleTextAttribute' collect2: error: ld returned 1 exit status

BTW, huge improvements you made to Xoptfoil, thanks.

John

jxjo commented 4 years ago

Hi John, thanks for the feedback and the issue!

Unfortunately I do not have LINUX so it's a little difficult for me to analyze. Maybe you can support? It seems that the precompiler directive "#ifdef UNIX" does not work... Did you use the make file from this repository? Here I added the compiler flag "-cpp" to activate the pre compiler. I'm not sure if the directive "#ifdef UNIX" also works in an LINUX environment? It should ...

Thank you and regards Jochen

jxjo commented 4 years ago

... forgot to say:

Sorry! But this should be a minor thing to implement if you (somebody) could test it.

joyo44 commented 4 years ago

Hi Jochen,

sorry, i have no experience with compiling for mixed OS.

Normally Gfortran should support the derictives linux, linux, unix and unix. I tried that and inluded an false statement behind the '#ifdef' and the compiler always jumped to WINDOWS and popped up with an error. Then I compiled os_utils allone and got the warning Illegal preprocessor directive - very strange.

I have no idea, what's going on - may be Daniel Prosser can help.

Kind regards and stay healthy.

John

jxjo commented 4 years ago

Hi John, ... I think a got a solution (maybe not the best). Add an additional gfortran compiler option to set the precompiler macro: "-dUNIX=1". You'll find it in the updated CMakeLists.txt. I'll provide later the colored output for UNIX/LINUX. It would be great, if could test it. Thanks! And regards - and yes, stay healthy! Jochen

joyo44 commented 4 years ago

Hi Jochen, that works! I run an example without any problems.

Sure I can test the changes for LINUX.

Regards, John

jxjo commented 4 years ago

Hi John, with the lastest commit there should be some color in the show_details mode like this

grafik

Thanks for your support!

Jochen

joyo44 commented 4 years ago

Hi Jochen, looks like your latest commit works:

grafik

John

jxjo commented 4 years ago

... uff! ;-) John, thanks again. If you have any further suggestions please go ahead...