Writing the first ReactOS application.

Got a ReactOS tutorial to share? Drop it in here

Moderator: Moderator Team

vicmarcal
Test Team
Posts: 2733
Joined: Mon Jul 07, 2008 12:35 pm

Re: Writing the first ReactOS application.

Post by vicmarcal »

Which command are you using to compile the .c file?
In the screenshot seems you are using "g++ cfilename.c", correct use is "makex cfilename"
Qrchack
Posts: 3
Joined: Tue Apr 26, 2011 12:20 pm

Re: Writing the first ReactOS application.

Post by Qrchack »

Code: Select all

C:\Users\Guest\Downloads\ReactOS-0.3.13-REL-src\ReactOS-0.3.13\base\setup\firstapp> makex firstapp.c
make.exe: Nothing to be done for 'firstapp.c'.

Total Build Time: 00:00:00
User avatar
Saibamen
Posts: 212
Joined: Mon Jul 19, 2010 11:19 am
Location: Poland
Contact:

Re: Writing the first ReactOS application.

Post by Saibamen »

Must be "make firstapp".
ReactOS Forum Global Moderator
IT-Maniak.pl administrator
Qrchack
Posts: 3
Joined: Tue Apr 26, 2011 12:20 pm

Re: Writing the first ReactOS application.

Post by Qrchack »

Code: Select all

C:\Users\Guesst\Downloads\ReactOS-0.3.13-REL-src\ReactOS-0.3.13\base\setup\firstapp>make firstapp
cc     firstapp.c     -o firstapp
process_begin: CreateProcess(NULL, cc firstapp.c -o firstapp, ...) failed.
make (e=2): Couldn't find specified file
make.exe: *** [firstapp] Error 2
'Couldn't find specified file' - here was 'Nie można odnaleźć określonego pliku' - translated to English
User avatar
Saibamen
Posts: 212
Joined: Mon Jul 19, 2010 11:19 am
Location: Poland
Contact:

Re: Writing the first ReactOS application.

Post by Saibamen »

Location should be "C:\Users\Guesst\Downloads\ReactOS-0.3.13-REL-src\ReactOS-0.3.13\"

Greetings
ReactOS Forum Global Moderator
IT-Maniak.pl administrator
Tonix
Posts: 89
Joined: Tue May 22, 2007 11:33 am

Re: Writing the first ReactOS application.

Post by Tonix »

Update

rbuild files are now obsolete you should use cmake files:

Tuturial part from [now.. edit the setup.rbuild located in SETUP directory and ADD then new FIRSTAPP entry.]
to [now.. is time to write the c-code... is a good idea to write some REM, something like that:]

shuold be substituted by
[..]
now.. edit the CMakeLists.txt located in SETUP directory and ADD then new FIRSTAPP entry.

add_subdirectory(reactos)
add_subdirectory(setup)
add_subdirectory(usetup)
add_subdirectory(vmwinst)
add_subdirectory(welcome)
add_subdirectory(firstapp)

open FIRSTAPP directory and create a new Cmake file named: CMakeLists.txt copy this code on it:
add_executable(firstapp firstapp.c)
set_module_type(firstapp win32gui UNICODE)
add_importlibs(firstapp gdi32 user32 shell32 msvcrt kernel32 ntdll)
add_cd_file(TARGET firstapp DESTINATION reactos NO_CAB FOR bootcd)
[..]

Tuturial part [now... JUST go on ROSBE shell... and type: MAKE FIRSTAPP]
shuold be substituted [now... JUST go on ROSBE shell, output directory, reactos ... and type: ninja firstapp]


Tuturial part from [edit firstapp.rbuild and add this entry: firstapp.rc] to [now.. create resource.h]
shuold be substituted with:

edit CMakeLists.txt and add this entry: firstapp.rc
like this:

add_executable(firstapp firstapp.c firstapp.rc)
set_module_type(firstapp gdi32 user32 shell32 msvcrt kernel32 ntdll)
add_importlibs(firstapp kernel32 gdi32 user32 )
add_cd_file(TARGET firstapp DESTINATION reactos NO_CAB FOR bootcd)
uppusaikiran
Posts: 8
Joined: Thu Mar 12, 2015 3:19 pm

Re: Writing the first ReactOS application.

Post by uppusaikiran »

After this how to see the output on the screen
uppusaikiran
Posts: 8
Joined: Thu Mar 12, 2015 3:19 pm

Re: Writing the first ReactOS application.

Post by uppusaikiran »

means if we made changes it is showing a red mark on the folder of setup
how to get rid of the red mark
And how to build reactos bootcd from here
Tonix
Posts: 89
Joined: Tue May 22, 2007 11:33 am

Re: Writing the first ReactOS application.

Post by Tonix »

you can compile te boot cd with
ninja bootcd
command int the output\reactos directory, it will be created there.

the red mark on the folder means that your local version is different from the version on-line in the svn repository.

You need to remove the changes or commit the to the svn online repository.

But only official developers have write (commit) access to the online repository
and a tutorial app is not something that should be present in the official sources.

you can test you app duoble clicking it, if you work on windows,
it's in the output folder/base/setup/firstapp/firstapp.exe
User avatar
linrx
Posts: 9
Joined: Fri May 19, 2017 4:09 pm
Location: Singapore

Re: Writing the first ReactOS application.

Post by linrx »

Pleased seeing some C code working on ROS. At my age it gives me more meaning seeing old wheels being reinvented than a brand new car from Microsoft. Keep up the good work, imho :)
User avatar
legendarytraveller
Posts: 1
Joined: Thu Nov 09, 2017 3:27 pm

Re: Writing the first ReactOS application.

Post by legendarytraveller »

Is it possible use C++? I mean making a cpp file and a hpp file (header) for an application.
ThFabba
Developer
Posts: 293
Joined: Sun Jul 11, 2010 11:39 am

Re: Writing the first ReactOS application.

Post by ThFabba »

legendarytraveller wrote:Is it possible use C++? I mean making a cpp file and a hpp file (header) for an application.
Yes, it works the same way as for C.
To enable the full feature set (exceptions, standard library), you just need to add

Code: Select all

set_cpp(WITH_RUNTIME WITH_EXCEPTIONS WITH_STL)
to your CMakeLists.txt
ThFabba
Developer
Posts: 293
Joined: Sun Jul 11, 2010 11:39 am

Re: Writing the first ReactOS application.

Post by ThFabba »

Just look further in the thread (i.e. scroll up on this very page): viewtopic.php?p=115149#p115149
Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests