Set name for c++ static library in netbeans - c++

I have a project that was initially named library-myproject and is located within the directory ./library-myproject/. When I compile the project I get an artifact called liblibrary-myproject which wasn't a problem while I developed and tested that library, but now when I need to use it as part of another project I can't live with that name.
Going through every single settings in NetBeans 8.02RC I'm still unable to find a way to change the name of the artifact, even if I change the name of the project. Attempting to change the makefile is futile since netbeans recreates it every time.

You can edit output name from netbeans project
Right click on Library in netbeans
Open Properties
Build->Archiver->Output. At the end you will see name of lib (SomeName.a)
Change it to suiltable name you need.
Rebuild Project. You are good to go...

Related

Eclipse C++ in Clearcase vobs: Unresolved inclusion

I would like to get your thoughts on why I am getting an "unresolved inclusion" error for certain .h files included as part of my project.
I actually cloned the project from another existing project, by simply copying, pasting and renaming.
Inside the cloned project, which originally had only a src/ directory, I also created a tst/ directory and did right-click->New->Folder and from the menu, clicked on Advanced >> and selected "Link to alternate location (Linked Folder)" and browsed to the relevant path under /vobs to add the source folder to my project.
Once I did this, the indexer started rebuilding the index, at the end of which I got the above mentioned inclusion errors.
The .h files could be located inside a specific folder path under /vobs; I first tried including this path by right-clicking on the cloned project and choosing Properties->Paths and Symbols->Includes to update the include list with the folder path. This didn't resolve the error.
Subsequently, I tried repeating the above procedure for the newly created tst/ directory from within the project; that didn't resolve the error either.
Not sure what is it that I am missing here.
Any suggestions would be appreciated.
Check first if those files are there, in your view. '/vob' could mean dynamic view, mounted under /vob.
I would rather work with a snashot view, which would download those same files on disk (rather than using the MVFS, Multi-Version FileSystem of a dynamic view).
Then, when you are sure the files are there, and cleartool ls shows them correctly loaded, you can double-check your inclusion paths, as mentioned here
"unresolved inclusion" means the file can't be found.
This means the directory containing it hasn't been specified to CDT or it has been misspelled.
If spelled correctly, normally you would specify the path with Project --> Properties --> C/C++ General --> Preprocessor Include Paths, Macros etc. on the Entries tab as a user entry.
Note that it depends on the type of project.
When you select File --> New -> C/C++ Project you are presented with various options.
The options are for the kind of builder used.
Some, such as Meson, Qt , Arduino and maybe others don't have the option "Preprocessor" option.
My guess is that you are not set in a view when you start Eclipse. This will prevent resolution of the the absolute "/vobs/..." paths. If you start Eclipse from GNOME (or any other windowed environment) the current working directory of Eclipse is likely your home directory. Without a view context, the /vobs/... paths will not contain any files under source control.
You COULD use /view/myview/vobs/myvob/... in the include paths, but that would mean EVERYONE who would use the project would have to either start your view or create and start an identically named one... And that's just the start of that particular can of worms.
You may want to confirm how Eclipse handles relative paths in the include path. Do they start from the current working directory of Eclipse? The project home directory? Somewhere else? That may give you a safe view-independent way to specify your include paths.
I would try setting a view and starting Eclipse from within the subshell spawned by cleartool setview. Then verify whether the includes are accessible.

Setting up C++ include settings for a large library such as Paraview and QT in Eclipse

I have an application where I am compiling against the libraries Qt (5.11) and Paraview (5.6). I am developing in C++ and I am also coding in Eclipse.
Yes, I am aware that Paraview is more of an application then a library. However, I will be using it as a library to intergrate Paraview in my application in order to visualize some data. I could use QT creator and that would take care of the QT library. However, I am not very familiar with QT creator as an IDE and my entire workflow has been based around eclipse. For this, I would like to utilize components that I am familiar with.
Now, as many of you know, the QT library is large, very large. So is Paraview. I could create a search path for each folder containing the header files I need in the C++ include settings. If I go in this direction, then my library search path will be long, very long. Also, there might be a situation where I need to change computers (for whatever reason), I would then need to edit the search paths for the new computer and that will take time.I had thought that I could only include the paths to the include files that I needed. And I have started to do that. However, when I compile my application, I noticed that the libraries would use include files that are located in a directory that Eclipse is not even searching in. At the end of the day, I would need to include all of the directories to which the header files are stored in.
I was wondering if there might be a better method to reference all of the files that my project needs? Both come with make files (I believe that Qt includes a QMake file?). Is there a simpler method to include all of the files instead of editing the C++ include path for eclipse? I did see an option for QMake in Eclipse, is there anything that I can do with that feature to compile to QT library with my application?
Thank you and any feedback is appreciated. Also, feel free to suggest edits or clarification so that my description is clear.
Note some good practices when working with eclipse and qt or other large library.
Include the directories with a headers
If you use option "Generate Makefile automatically", add group include path with GUI Eclipse:
copy the directories with a headers (via system explorer);
go to project properties/C/C++Build/Settings/Tool Settings/GCC C++
Compiler/Includes.
paste directories (Ctrl+V) into "Include paths" list.
If you are using a qt-eclipse-integration plugin, you can add folders via the Discovered scanner configuration. You can find it if open: project properties/C/C++ Include Paths and Symbols/Add Contributed...
Create new project
if you already have a customized project, you can use it as a template:
make a copy of the customized project and name "mytempate";
delete all files from "mytempate".
When you want to create a new project, copy the template and specify (in the copy dialog) the path where the source codes are located.
Now you have a finished new project with settings and code.
Change computers
Use one of the ways:
1. Export C/C++ project settings for use in another workspace via project properties/C/C++ General/Paths and symbols/Includes/Export Settings...
2. Pack in the archive eclipse and workspace and copy your another computer.

Relative path for related projects in netbeans

I have a project which is dependent on a library created from another project. While this runs in netbeans for my desktop, it does not, when i build it remotely because the related project(which i add using the properties tab, in Linker->Libraries) with the library is added with the absolute path! Is there a way to add this with relative path?
While, I have not found a proper solution to this problem, currently I am manually moving the library to the path where it is required to be, by the main project in the remote computer.

Setup cocos2d-x application through visual studio 2010 project template

I'm trying to setup an application on Windows 7 using Cocos2D-x.
I followed this tutorial.
I did the following:
Built the library running Build-win32.bat script. Works.
Installed VS2010 project template. Works.
Run successfully all test programs.
Created a new cocos2D-x project through the installed template. Works
When I compile the Hello World application I have the follwing errors:
error C1083: impossible to open inclusion file 'CCstdC.h' No such file or directory
error C1083: impossible to open inclusion file 'cocos2d.h' No such file or directory
It's a wrong include path.
I could fix it by manually modifying include path but since I'm creating project through the template I-d like to solve this, possibly not having to modify paths manually for each new project I'll create.
Did anyone ever had the same issue?Do you know how to fix this?
Well, I setup cocos2dx projects like this:
create an empty win32 app in VS
open the folder contains your .sln file (your solution folder)
open the cocos2dx package (i.e. cocos2d-1.0.1-x-0.12.0.zip) with 7z or something
drag cocos2dx, and optionally CocosDenshion, Box2D, etc. to your solution folder
add cocos2dx project (cocos2dx\proj.win32\cocos2d-win32.vcxproj) into your solution
go to your project's properties, select C/C++->General, add the following entries to your Additional Include Directories option:
..\cocos2dx; ..\cocos2dx\include; ..\cocos2dx\platform; ..\cocos2dx\platform\win32; ..\cocos2dx\platform\third_party\win32\OGLES
and ..\CocosDenshion\include if you're using the SimpleAudioEngine
in the Linker->Input->Additional Dependencies option, add libcocos2d.lib, and libCocosDenshion.lib if you use the audio engine; in the Linker->General->Additional Library Directories option, add $(OutDir)
go to the Configuration Properties->General->Output Directory option, set it to $(SolutionDir)\build\
open the project property for cocos2d library, go to the Configuration Properties->General->Output Directory, set it to $(SolutionDir)\build\, also do that to the rest of the libraries you included.
All set, you're ready to go.
Unfortunately that template is not that useful. I believe that in a previous version of cocos2d-x (the one that tutorial is based on) the paths were absolute, and referenced the cocos2dx, cocosdenshion projects directly.
Now, as they're relative (..\..\cocos2dx), and they are not copied to the solution directory when a project is created, it just doesn't work.
You could obviously fix the paths (as you suggested) but my suggestion is: copy the HelloWorld project and use it as a template. The solution structure is much better than the one in the template as it's already prepared for iOS, win32 and Android. Trust me, can't get any easier than that.
Now, here's the catch: if you copy the HelloWorld project to a sibling folder, you're done, as all the references are already setup. If you want to copy to other place you'll have to also copy cocos2dx, cocosdenshion along, leaving the target structure like:
target_path\cocos2dx
target_path\cocosdenshion
target_path\Copy_of_Hello_World
I solved opening the cocos2dx library solution and add to it a new project through VS template wizard.

Project dependency in Eclipse CDT

I'm using eclipse for the first time. I'm a seasoned VisualStudio user, so I'm trying to find similar functionality in eclipse. I have two projects, A and B. Project A spits out libA.a when it's done compiling. Project B links against libA.a. Here is my problem.
I compile project A then project B, everything is fine.
I make a code change to project A that requires a build of project A.
I try to build project B, but it states that no changes have been detected.
How do I make project B aware of the output of project A?? Currently I'm having to do a clean build of project B for it to re-link against libA.a.
Thanks.
EDIT: In my ProjectB->Path and Symbols->References tab, I have project A checked. This doesn't relink after project A is rebuilt.
Try the below settings:
Go to properties of Main Project → C/C++ General → Paths and Symbols → References
Tick all the dependencies.
You go into Project Properties of Project B, select Project References and make it reference (depend) on Project A.
Edit, appears to be a known bug
One can work around this problem by using the touch command.
In Eclipse, as part of C/C++ Build/Settings is the tab 'Build Steps'. In the pre-build steps command line, enter touch filename.
filename is any file in your application. This could be the file with main(). This could be a special file just for this workaround, touchdummy.c, which can be a tiny file, which compiles quickly.
When the application builds, even if you didn't change any sources, the touch command causes make to rebuild the application. If the library was rebuilt, then the application gets rebuilt with the new library.
One can read about how touch affects the date/time of the file here.
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/touch.html
Edit: The exact command in Eclipse would be touch ${ProjDirPath}/src/main.c
Edit: This command should work, but it appears that if the 'main' project did not change, the pre-build step is not executed. Also the touch command causes eclipse to prompt to reload the file it touched. A large annoyance.
Eclipse projects depend on each other by virtue of the checkbox in the project's properties (dependent projects?) which is how Eclipse decides which to build. You can set this yourself, but it's usually set when you change your Java build path.
By default at least with QNX C++ projects, it WILL NOT check for changes in other projects.
Right click on the project, and expand "check dependencies on/off"->"check user headers only"
It seems to work, roughly...
It appears to do a makedepends on the code, and adds *.d files to the output folder which are simply depends file that list the header files.
Note: these do not appear to get regenerated, and get out of date - I do not know how to regenerate them.
For Project A (library):
Properties>C/C++ Build>Settings>Build Steps>Post-build steps> touch -m ${ProjDirPath}/source/build/build_updated.cpp
You should create folder "source/build" firstly and don't add in that folder any other files.
For Project B:
Properties>Project References> check Project A
Properties>С/С++ General>Paths and Symbols>Source Location>Link Folder>Link to folder in the file system> find and pick "source/build" folder which you created for project A before.