Copy Link
Add to Bookmark
Report

creating project file for Visual C++

sang's profile picture
Published in 
GP32
 · 17 Aug 2021

you can start from an empty project file as follows.

  1. create an empty project file.
    1. select the menu "File/New...", select "Win32 Application" in "Projects" tab and type the name as you wish. select the location where you want your project file to be created in "Location" field. (refer to "project structure recommended by Gamepark") as default, Visual Studio create a subfolder under the folder you select as location. be careful. if all completed, press "OK" button.
    2. select "An empty project" in "Step 1 of 1" and click "Finish" button. you may see the summary about project file generation.

  2. adding file(s)
    1. first, you should create a resource file as follows.
      1. select the menu "File/New...", select "Resource Script"m type file name and click "OK" button.
      2. select the menu "Insert/Resource", select "Import...", select three files "gpskin.bmp", "gpicond.ico" and "gpiconr.ico"(included in GP32 SDK) and press "Import" button. (it may show a message about not being able to display non-8bit image file. but you can ignore this.) set the ID for Bitmape to "IDB_BITMAP1", ID for 8bit icon to "IDI_MAIN_ICON", Condition for 8bit icon to "_DEBUG", id for 24bit icon to "IDI_MAIN_ICON", and Condition for 24bit icon to "NDEBUG". (you can set the properties for icons by clicking right mouse button in "Resource" tab and selecting "Properties" menu.)
      3. now you should modify resource.h as follows. open resource.h and change the value of IDI_MAIN_ICON to 102 and value of IDB_BITMAP1 to 109.

    2. add your own gpmain.c file by selecting the menu "Project/Add To Project/Files...".

  3. configuration for each Target
    1. Debug Target
      1. select "Use MFC in a Shared DLL" as "General/Microsoft Foundation Classes"
      2. add path "work/lib/win32/gpwin/include" (in relative format. e.g, ../../../lib/win32/gpwin/include) to "C/C++/Preprocessor/Additional include directories"
      3. add "winmm.lib gpwind.lib" in "Object/library modules" field in "Link/Input", "work/lib/gpwin/gpwinlib/debug" in "Additional library path" field. (also in relative format)

    2. Release Target
      1. select "Use MFC in a Shared DLL" as "General/Microsoft Foundation Classes"
      2. add path "work/lib/win32/gpwin/include" (in relative format. e.g, ../../../lib/win32/gpwin/include) to "C/C++/Preprocessor/Additional include directories"
      3. add "winmm.lib gpwinr.lib" in "Object/library modules" field in "Link/Input", "work/lib/gpwin/gpwinlib/release" in "Additional library path" field (also in relative format))

  4. time to build.

you can make your own project more easily by modifying template project file provided by us in following steps. (let me call the name of your project test.)

  1. copy following file from work/project/template/win32 to the location where you want to make project file.
    1. template.dsw : Visual C++ Workspace file
    2. template.dsp : Visual C++ Project file
    3. template.rc : Visual C++ Resource file
    4. resource.h : resource header file
    5. resources/gpskin.bmp : Skin image file
    6. resources/gpicond.ico : icon file for Debug target
    7. resources/gpiconr.ico : icon file for Release target
    8. Visual C++ doesn't allow debugging if the application icon is not made in 8bit color. we think it's a kind of bug. anyway, to debug, we provide one more icon file made in 8bit color. of course, you can use your own icon file.

  2. modify the names of template.dsw, template.dsp and template.rc to test.dsw, test.dsp and test.rc respectively.
  3. modify the contents of test.dsw and test.dsp using any text editor. just replace all the string template with test(project name).
  4. add your own gpmain.h and gpmain.c to the project.
  5. * more...
    set the following values to the proper values for your project.

    1. include path ("Additional include directories" field of "Preprocessor" Category in "C/C++" tab)
    2. library file path ("Additional library path" field of "Input" Category in "Link" tab)

← previous
next →
loading
sending ...
New to Neperos ? Sign Up for free
download Neperos App from Google Play
install Neperos as PWA

Let's discover also

Recent Articles

Recent Comments

Neperos cookies
This website uses cookies to store your preferences and improve the service. Cookies authorization will allow me and / or my partners to process personal data such as browsing behaviour.

By pressing OK you agree to the Terms of Service and acknowledge the Privacy Policy

By pressing REJECT you will be able to continue to use Neperos (like read articles or write comments) but some important cookies will not be set. This may affect certain features and functions of the platform.
OK
REJECT