Labels

Android (1) bash (2) boost (2) C (34) C++ (2) cheatsheet (2) CLion (6) css (3) Debian (33) DL (17) Docker (2) Dreamweaver (2) Eclipse (3) fail2ban (4) git (5) GitHub (4) Hacking (3) html (8) http (1) iOS (1) iPad (1) IRC (1) Java (31) javascript (3) Linux (167) Mac (19) Machine Learning (1) mySQL (48) Netbeans (4) Networking (1) Nexus (1) OpenVMS (6) Oracle (1) Pandas (3) php (16) Postgresql (8) Python (9) raid (1) RedHat (14) Samba (2) Slackware (47) SQL (14) svn (1) tar (1) ThinkPad (1) Virtualbox (3) Visual Basic (1) Visual Studio (1) Windows (2)

Sunday, 23 August 2020

C++ File structure in both Netbeans and CLion

Below shows the file structure of a simple C++ application in both Netbeans and CLion (on a Mac).




The code is close enough to being the same and is as follows;

NB_CL (Netbeans)

#include <cstdlib>
#include<iostream>

using namespace std;

int main(int argc, char** argv) 
{
    cout << "NB" << endl;

    return 0;
}

CL_NB (CLion)

#include <iostream>

int main()
{
    std::cout << "CL" << std::endl;
    return 0;
}


The NB file structure after build is;



With the CLion structor being as follows;



With the NB binary highlighted as below;



and the CLion binary highlighted as below;


The Makefile for the NB application can be found here, while the one for the CLion application can be found here

To build the NB application elsewhere (the below examples were copied to a Slackware Linux system).

Copy the Makefile, main.cpp and the nbproject folder;


then run make as below;


the binary can then be found at dist/Debug/GNU-MacOSX/nb_cl (need to check why GNU-MacOSX)

The CLion system seems to be slightly more complex (to me) but for the time being, copying the full directory across and running make in cmake-build-debug builds the binary in that directory. This may be due to the use of cmake? (I'll come back to this).






No comments:

Post a Comment

Note: only a member of this blog may post a comment.