Abdul Khaliq
Abdul Khaliq

Reputation: 2463

netbeans c++ deployment

I had developed a small program in netbeans using c++. I need to know how can i deploy/run the package on another linux system

Abdul Khaliq

Upvotes: 0

Views: 1283

Answers (5)

Dat Chu
Dat Chu

Reputation: 11140

Typically, once compiled, your executable will need several libraries. Chance is that those libraries will also be available on the target linux system.

Thus, you can simply copy your executable over to the other system. If you run ldd on your executable, you should see the list of libraries your executable is dynamically loading. Those libraries should be available on the target system as well.

In case your executable makes use of resources such as images and other binary files, you can use a resource system (e.g. Qt Resource System) and compile those binary files into your executable.

The easiest way to test is to do the copy, run

ldd yourExecutable

on the target system. It will tell you if you are missing any library. Install those libraries using the system package manager.

Of course, you also have the option to statically build all libraries into your executable. However, this is not recommended since it makes the executable too large and complicates matters.

Upvotes: 1

Muhammad Ummar
Muhammad Ummar

Reputation: 3631

I have seen your code, you probably missing XML files in the current folder... where the executable is located... paste then and then run as ./your-executable

Upvotes: 1

tnacho
tnacho

Reputation: 148

You should use a makefile as suggested. I know that NetBeans can generate one, but it's been a while since I last did so. Maybe this can help: http://forums.netbeans.org/topic3071.html

Upvotes: 1

Kyle
Kyle

Reputation: 3300

What type of package is your netbeans compiler creating? deb,rpm? If you are moving the package to a different linux install you will need to use that distributions package type. Ubuntu - deb Fedora/Redhat - rpm etc... I'm not sure how you change this in netbeans but I'm pretty sure it has the ability to. A google search could help you more.

Upvotes: 0

THE DOCTOR
THE DOCTOR

Reputation: 4555

I recommend that you use a makefile to recompile on your target machine which will ensure that your program is deployed properly.

Upvotes: 1

Related Questions