How to change project type from "Cross GCC" to "Linux GCC"? - linux

In Eclipse I've created static lib, but it seems i forgot to switch to "Linux GCC" instead of default "Cross GCC"
How to change existent project to "Linux GCC"?

Right-click on your project and select Properties. Once you're in the properties window, open C/C++ Build -> Tool Chain Editor and you'll see a dropdown box called Current toolchain, where you can select which compiler configuration you'd like to use. Select Linux GCC and you're done!

Related

No index in Eclipse CDT project checked out from SVN

I have checked out a cross-compilation project from SVN on Eclipse (on a Linux system). I am unable to open a functions declaration from the functions's right-click context menu (or by pressing F3). Upon research, I found out I don't even have anything like Index -> .. in the project's right-click menu. I have tried a lot with the Preferences -> C/C++ -> indexer but no useful results. I am not using Eclipse to build it but there are no errors since I can build it using makefile
PS: Though there are a few questions with the matching title, but none of them helped me
Here is the solution found after a million attempts. The project should be checked-out as C/C++ project, by selecting import using new project wizard.. The index will NOT be available in the SVN projects checked-out directly. Hope it saves some one's time
Eclipse Kepler SR2 on Windows 7 here.
Faced the same issue, the following sequence of inputs made it work for me:
Import...
"Checkout projects from SVN."
Select branch etc.
Check the "Check out project configured using the New Project Wizard" radio button.
Select "C/C++ -> C Project."
Pick a toolchain, doesn't matter which if you use an external one.
Now you can right click on the project (once fully checked out) and rebuild the indexer.
I am using Indigo and solved it as follows (without checking out again!)
Right click on project in question and select New->Convert to a C/C++ Project
After selecting toolchain, indexing gets built automatically.

How to add a default include path in MSVC++ 2012?

I would like to add an include and library path to the default configuration in VC++ 2012. I know I can add it manually per project, but there is a checkbox "Inherit from parent or project defaults". I would like to modify this "project defaults" so it applies to all my projects.
Any clue of where to edit this?
***EDIT
No, that answer doesn't help. I edited the vsvars32.bat file, run the bat to check that INCLUDE and LIB variables where updated with my own path (and they are), but when I start MSVC++ 2012 my added path is not included.
It's a bit of a pain, and there is a blog post on MSDN that explains in detail, but in summary here's how you do it:
Open a project, any project.
From the menu, choose View / Property Manager (near the bottom of the menu)
In the property manager window, expand the project tree to show Debug and Release nodes
Expand either Debug or Release (it doesn't matter which)
Right-click on Microsoft.Cpp.Win32.user
Choose Properties from the pop-up menu
You should see a dialog where you can edit the VC++ Directories entry like this:
Once you OK through everything, any project you create or load will inherit these defaults.

Purpose of "Target machine" field in Visual studio -> Linker-> Advanced Options->Target Machine

I'm porting a 32-bit C++ app to 64-bit (using VS2008).
I'm not sure what does this field mean in the VS2008 ::
Visual studio ->Configuration Properties-> Linker-> Advanced Options->Target Machine.
By default it's value is set to "Not set".
Is it compulsory to change it's value to "MACHINEx64" if I want my application to be ported to 64-bit executable.
Yes, this is a very important option. It sets the IMAGE_FILE_HEADER.Machine field in the executable file. The very first field of the EXE or DLL header.
Windows check this when it loads an EXE and knows whether it needs to create a 32-bit or a 64-bit process from that field. The only reason it is a the Linker + Advanced property page is because you don't normally change it. The setting is pre-selected by the project configuration you created. If you get "Not Set" then you are basically doing it wrong, hard to guess what you are doing.
Assuming you have a properly configured project that builds a working 32-bit build for your program, you create the 64-bit build with Build + Configuration Manager. In the "Active solution platform" combobox at the upper right, select <New...>. Pick "x64" in the dialog. Hopefully the other defaults (Copy settings from = Win32, Create new project platforms ticked) are correct for yours. Go back to the Linker + Advanced property page and the setting should have changed to MachineX64.
This option relates to the linker option /MACHINE and is a hint for the linker for what target architecture to link the object code if he (the linker) cannot determine this from the object file. As MSDN states you usually have not to specify this. So no you don't need to explicitly specify this flag when porting your code.

Eclipse with powerpc-linux-gcc possible?

I program a embedded Linux on a separate target. For that I use Eclipse as a editor and the powerpc-linux-gcc.
That's a bit uncomfortable.
Is it possible to use a powerpc-linux-gcc in Eclipse?
Yes, but you want to install (via Help -> install new software -> from all available sources -> Mobile and device development) C/C++ cross compiler support and possibly C/C++ GDB hardware debugging.
When you start new project, selecet C or C++ project, then Executable, then "empty project" (or something else) and then make sure, in to selecet "Cross gcc" in right listbox. Press Next button until the page with cross compiler prefix and path shows. There you need to enter prefix (powerpc-linux- in your case) and you can also select your compiler's directory (if you have not added it to path).
When you have project set up this way, selected toolchain is used to build. You can alse set up "GDB hardware debugging" session to debug your application remotely.

How to compile unsafe code in MonoDevelop 2.4

I am trying to compile unsafe code blocs in MonoDevelop 2.4. Apparently (Google search result) there is supposed to be a a tickbox under Options->Build->General that allows the compiler to handle unsafe blocks but it is not there in 2.4. Does anybody know how to set MonoDevelop to compile unsafe code?
For version 2.4.2, select the project you want to turn on unsafe, note, this is important. You have to select one project, not the whole solution.
Right click on that project and then choose Option, under the Build -> general, under Language Options, check the "Allow 'unsafe' code".
Thank you for the guy above me to give me that hint.
In Solution view, on the left by default, click on your project's name. Then, in the menu bar, click on project, then click on '"thenameofyourproject" options'
Then under Compilation or Build (I have a french version) you have a line named build I guess. Then you will see on the right written "complmentary options" or something like that.
Type in /unsafe and there you go
for Mono 5.9.6 it's slightly different:
in the solution pane, select your project and open the options
under "build", select "General"
then in the "Language Options" category, check "Allow 'unsafe' code".
Right Click your project's name > Options > Build > Language Options & Check
"Allow 'unsafe' code"

Resources