Xcode 6 + xcodelegacy - Compiles Fine but Still Shows Errors - xcode

To be able to compile an Xcode project that contains some inline Intel assembler code in it, I have used the brilliant xcodelegacy by Frédéric Devernay. Using the LLVM GCC 4.2 compiler in Xcode 6, I am now able to compile and debug the application. The build shows only warning errors at this point, no fatal errors.
The assembler code is definitely being compiled, because I can step into it while in the debugger.
However, when you click on a file with the assembler instructions (i.e., _asm { } ), Xcode still shows fatal errors. I assume this is because the analyzer that scans these files (something like the old Code Sense I assume) is not using LLVM GCC 4.2.
I cannot figure out how to prevent these errors. While they do not impact my ability to work on this project, they are a bit annoying since they are not "real." Is there a way to fix this?
Thanks in advance for the help.

Those are just editor problems. Either right-click on the file in Xcode and chose "Open Using External Editor", or open it with another editor (such as TextWrangler).

Related

How do I compile PCSXR source code on Windows into an executable?

TLDR at the bottom.
I've been running an application I've found on codeplex.com called PCSXR. However, I believe a Windows update has caused the program not to function properly or it's missing some Windows Visual Basic add-on since it was fine before I cleaned installed Windows 10 for fixing a problem that recovery couldn't fix.
I've tried version 1.9.92 executable but it has crash issues playing cinematics.
Version 1.9.93, which is most stable and I was using, no longer can read the DLL plugins in the folder. Making it unusable.
After browsing around. I found this post that this person solved the problem using Dev C++ to compile the source code. I've attempted to build it but I keep getting thrown errors. Wrong architecture which I've solved by setting it to 32 bit compile but other errors prevented it compiling.
After Googling how-to around and talking with some other programmers. I've been going back and forth with different tools on how to compile it. Code Blocks, Dev C++, MinGW and an old Git program on Windows to run Bash. I even ended up having missing config.h which is in the header and even winres.h missing.
I somehow managed to compile it through WSL (Windows Subsystem for Linux) with Ubuntu, XFCE4 Desktop through VcXsrv to display XFCE4 through a window. PCSXR starts, has plugins but crashes when I run it. From what I've been told, the error due to WSL not supporting sound. So WSL failed.
I've tried Ubuntu "Try It" CD environment but fails to compile at all.
VirutalBox on latest version no longer works since they disabled it working on my machine since it doesn't have BIOS virtualization setting.
TLDR
I've been following their program documentation but it's not really detailed for Windows users.
So my question is: How do I build, in detailed steps, PCSXR either from updated source code here or 1.9.93 source here into a working Windows executable with its DLL plugins working? What programs I need, what do I type in what, what settings, where I find missing files etc.
I know this isn't probably the best question here but I've been at this for 2 whole days, Googling and asking.
I'm using Windows 10, AMD CPU, 64 bit with no BIOS virtualization support.
I managed to do it by following these steps on this forum post:
You need Dev C++ 5.11.
1).Go to File>Open>Directory of Pcsxr>win32>pcsxr.dev
2).Under Project select pcsxr. Right click and select project options.
3.In Project Options select compiler. Set Base compiler to "TDM-GCC 4.9.2 32bit Release" then click ok.
4).In the main menu of Dev C++ 5.11 look for Execute. Select Compile.
5).Wait for it to compile. If you were successful there should a
pcsxr.exe in pcsxr source directory>win32.
After following the steps and trying out all the most recent versions of the source codes available. This is my research results I posted after.
Thanks for the reply. It really helped a lot.
I've tried the 1.9.93 beta source code "pcsxr-1.9.93.tar.bz2"
(extracted with 7zip) and got a compile error about "#include
" not found.
I've tried the 1.9.94 alpha source code "pcsxr-1.9.94.zip" and it
compiled successfully. I got a "pcsxr\libpcsxcore\gte_divider.h"
missing error when loading the dev file in win32 folder but it seems
to work okay.
I've tried the up-to-date source code (last modification Feb 18, 2017)
and it compiled successfully. I got a
"pcsxr\libpcsxcore\gte_divider.h" missing error when loading the dev
file in win32 folder but it seems to work also. The background logo
that covers the main window seems to be blank grey until I start a
game.
I solved the winres.h issue by getting this missing Windows h Sample
file from github here:
https://github.com/Microsoft/Window...les/Win7Samples/winui/tsf/tsfcompart/winres.h
and just added it to the root of the project folder. I had to replace
'#include ' with '#include "winres.h"'.
I don't know about the built-in plugins source code. Some don't have a
dev file and they always throw errors when compiling. I've managed to
add working third party ones from emulator zone and the ones from
1.9.93 beta release "pcsxr-1.9.93-win32.zip" and managed to get 1.9.93 working great.

Breakpoints not working in xcode 4

I just started using Xcode to program a C++ openCV project.
The project is set up with an external makefile, /usr/bin/gnumake as build tool, and the program compiles and runs fine.
However, breakpoints gets skipped no matter what i do.
I have tried making a new project, selecting between gdb and LLDB, restarting Xcode++
There are numerous threads about this issue, but most talk about "Load Symbols Lazily", but as far as I know, this is not an issue in Xcode 4.5.2.
It is probably my limited Xcode knowledge that causes the error.
Help is greatly appreciated.
I could resolve my similar problem by disabling "Link-Time Optimization" for the Debug build settings.
Make sure that any kind of code optimization is disabled in your debug build settings (code stripping, optimization, etc). Then check that you really run the debug build and not the release version.
It would be great if XCode could automatically warn you when you have build settings that possible break the debugger...

Can't get apple llvm 4.1 compiler options to show up in xcode 4.5, only llvm gcc 4.2

On most projects, If I change the compiler I'm using from "apple llvm compiler 4.1" to "llvm gcc 4.2", the compiler options available later on in Build settings will change accordingly.
Right now, I'm doing a project using objective-c++ , but I'm noticing the compiler options don't update (see screenshot below). Anyone ever experienced this? Is there a way to fix this without creating a brand new project?
I was trying to switch to the apple llvm compiler to try using ARC (and yes, I've read http://philjordan.eu/article/mixing-objective-c-c++-and-objective-c++ and it's recommendation to not use ARC in this scenario).
NOTE: I'm using Xcode Version 4.5 (4G182)
I had the same problem and solved it by editing my project.pbxproj file using a text editor. I had inconsistent settings of "GCC_VERSION" in the file. I quit Xcode and then simply deleted all the lines with GCC_VERSION in them. Restarted Xcode and suddenly I got the default compiler (apple llvm) and all the appropriate compiler options.
Click the "All" label on the top gray bar, and all the options will show up:

Xcode makefile or compilation options

I am new to Xcode. Once I configure my C++ command line application to build, and it builds successfully, I have sometimes no clue about how Xcode calls GNU C++.
Is it possible to get the makefile that Xcode creates or how to see the compilation options created by Xcode?
Thanks
Xcode doesn't actually create a makefile; among it's other functionality, Xcode replaces make. But you can see all the options, etc., Xcode uses to build you code. Just open the project in Xcode, and select Get Info from the File menu. Browse the resulting dialog box for almost anything you could possibly want to know about Xcode build settings.
Or you could use a tool likePBTOMAKE, an OS X application that can convert Xcode projects into makefiles, but it hasn't been updated in a few years.

Xcode 3.2 + LLVM = no local symbols when debugging

I have a project for Mac OS X 10.5 that I'm building on 10.6 using Xcode 3.2. When I use GCC 4.2 for Debug build and hit a breakpoint, Xcode debugger displays local variable information normally. If I choose LLVM GCC 4.2 or Clang LLVM, when I hit breakpoint, local symbols are not available, and GDB says No symbol 'self' in current context if I try to print self or any other local symbol. In all cases Generate debug info option is set. The Debug configuration is set to $(NATIVE_ARCH) and 10.5 SDK, Build active architecture only option is set. When GDB starts, I can see it is being configured as x86_64-apple-darwin. I must be missing something obvious. How do I make GDB show local symbols when using a LLVM compiler?
For those not familiar, a little more detail to cdespinosa's answer, which worked for me, and which I voted up.
From the Xcode menu, select Project > Edit Project Settings...
Choose the Build tab
In the search box type "Optimization Level", choose that field, and select None.
Next search for "Debug Information Format", choose that field, and select "DWARF" or "DWARF with dSYM".
Would have put this in comments to his post if I had the privs. ;)
This cost me some serious time, and was frankly kind of sloppy on Apple's part, but in general I can't complain.
Make sure you're building with Dwarf symbols and no optimization. llvm is a new back-end, and not all of its optimized codegen is hooked up to debug symbol generation yet.
This may help. Try turning off "Link-Time Optimization" in the project's build options. That fixed a problem I had with missing debug symbols.
In fact, that fixed a bunch of weird problems I was having with Clang. I'd say that feature is just too bleeding edge to use yet.
GDB from FSF only added support for JIT code very recently.
I don't know whether Apple-supplied GDB has support for it at all (do you get reasonable stack traces?). If it does, this support is (apparently) incomplete.
I was having this problem and solved it by putting a tick next to the menu item: "Project > Set Active Build Configuration > Debug". Previously, the "Release" option was selected. Locals started showing up in the debugger for my project from then on.

Resources