Skip to content
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

Cannot compile dosbox-x under Ubuntu 16.04 #209

Open
zaxxxxx opened this issue May 8, 2016 · 8 comments
Open

Cannot compile dosbox-x under Ubuntu 16.04 #209

zaxxxxx opened this issue May 8, 2016 · 8 comments

Comments

@zaxxxxx
Copy link

zaxxxxx commented May 8, 2016

As per "INSTALL" I think I've installed every single libsdl that's required by dosbox but neither vanilla dosbox 0.74 nor this fork doesn't want to compile. I've also tried

apt-get build-dep dosbox

since dosbox is in the official repo but it didn't help either.

Here's the output of ./configure : http://pastebin.com/pFS6AZgt

And here's the output of make (showing only the last lines): http://pastebin.com/Jh2Y8Rtd

And lastly here's the output of make of the vanilla 0.74 dosbox which I'm not really interested in because it's already available in the official repo. It also dosen't build but it's output is a bit different (showing only the last lines) : http://pastebin.com/pNn2NgzS

Any help is highly welcome! I'd love to check this fork out because of it's windows 98 capabilities.

@aybe
Copy link
Collaborator

aybe commented May 8, 2016

Adding # define isinf(x) (std::isinf(x)) @ https://github.com/joncampbell123/dosbox-x/blob/master/src/fpu/fpu_instructions.h#L284 should fix it but ... it ends up like this 💃

dosbox.cpp: In function ‘void notifyError(const string&)’:
dosbox.cpp:543:28: warning: format not a string literal and no format arguments [-Wformat-security]
     LOG_MSG(message.c_str());
                            ^
g++: internal compiler error: Killed (program cc1plus)

Someone with Linux knowledge, can you take a look ?

@joncampbell123
Copy link
Owner

GCC doesn't like it when you declare that the function is like printf(), but then use a non-constant format string. You're supposed to use a string constant with the format string of printf.
You can eliminate that warning by changing it to LOG_MSG("%s",message.c_str());

I'm guessing G++ crashed because your #define isinf(x) (std::isinf(x)) makes a recursive macro that never finishes expanding. isinf(x) -> std::isinf(x) -> std::std::isinf(x) -> std::std::std::isinf(x) -> and so on. Try making isinf(x) a static inline function that calls std::isinf().

@zaxxxxx
Copy link
Author

zaxxxxx commented May 9, 2016

Thanks guys, adding # define isinf(x) (std::isinf(x)) worked like a charm and now it compiles fine.

@toddfraser88
Copy link

I'm having this issue aswell on ubuntu 16.04,
where exactly do i change the code to fix this?

@telanus
Copy link

telanus commented Aug 20, 2016

is there any solution to this?

@oleg-baskakov
Copy link

aybe's solution didn't work for me. I compiled all succesfully after manual fix:
add class prefix explicitly std::isinf(x) at https://github.com/joncampbell123/dosbox-x/blob/master/src/fpu/fpu_instructions.h#L457

@toddfraser88
Copy link

is this correct?

if (std::isinf(fpu.regs[st].d) && std::isinf(fpu.regs[other].d)) {

@joncampbell123
Copy link
Owner

@toddfraser88 that should be right, yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants