<< April 2020 | Home

Android SSL-Connection <-> Tomcat Server with self-signed certificate

Intro: Still working on 'bringing back Wood Games 3D' which have a rest-server in the background that handles leaderboards and some competition (the daily world championship). On android I was relying (in 2010/11) on scoreloop-service that handled this for me (but got taken down sometime). I later had an java-applet version for which I had to create a server on my own (since scoreloop was only for mobile). And this is the server I want now to handle android as well...

Problem Android 10(sdk 29) and also earlier(?) don't allow http-calls anymore. There are ways to 'opt-in' it back, but it makes absolutely sense to have a secured connection.

So if you stumbled over following you are right here:

javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.

Let's start

  • Setup Tomcat for SSL:

    1. Create certificate:

      keytool -genkey -keystore tomcat.keystore -alias tomcat  -keyalg RSA -keysize 4096
      

      Important: The CN/Name (first entry) must be the name of the server you are connecting to. At my (local) setup with only some IP-Address (e.g. 192.168.178.188 ) I had to choose this IP-Address as name (otherwise android will not be happy) But if you need to connect to a domain, you need to specify the domain-name itself

    2. After the creation keytool warns (at least at my current version):

      Warning:
      The JKS keystore uses a proprietary format. It is recommended to migrate to PKCS12 which is an industry standard 
      format using "keytool -importkeystore -srckeystore tomcat.keystore -destkeystore tomcat.keystore -deststoretype pkcs12".
      

      So do as you suggested. (Not sure if this is mandatory)

    3. Extract the cert:

      keytool -export -keystore tomcat.keystore -alias tomcat -file tomcat.cer`
      

      Type in the keystore password and the file tomcat.cer appears in your current folder.

    4. copy this file to your Android-Project in Folder res/raw

      cp tomcat.cer /home/..../project/res/raw
      
    5. locate your tomcat's server.xml:

      • TOMCAT-root/conf/server.xml
      • if running it from within eclipse: 'Project Explorer'-View->Servers->Tomcat->server.xml

      Usually there is already an SSL-configuration that just needs to be uncommented and setup to use our just created certificate(locate and change so it fits)

      <Connector port="8443" protocol="org.apache.coyote.http11.Http11Protocol"  
                maxThreads="150" SSLEnabled="true" scheme="https" secure="true"  
                clientAuth="false" sslProtocol="TLS" keystoreFile="FOLDER_WITH_KEYSTORE/tomcat.keystore"   
                keystorePass="FILLIN_YOUR_KEYSTORE_PASSWORD"/>     
      
    6. I had to activate legacy apache-http-client. I did try to use one of my own but the app crashed everytime (saying something like mismatched implementation-something).
      After the application tag include this:

      <uses-library android:name="org.apache.http.legacy" android:required="false"/>
      

      Not sure how long this option is available. It should be the goal to use the http-client of your own...

    7. restart tomcat. From now on your server accepts https on port 8443

      References:

  • android-project:
    Three (or more) problems that might occur with this topic and all will be gone once you have set up the right network-security-config:

    • Something about "cleartextTrafficPermitted....": You are not allowed to use http://...-calls (you can opt it in)
    • "Trust anchor for certification path not found": The ssl-connection's certificate is neither signed by a trusted CA nor known (yet)
    • "hostname in certificate didn't match: != ": The CN of your certificate does not match the hostname you are calling it with.
    1. In your android-project create a file: res/xml/network_security_config.xml:

      <?xml version="1.0" encoding="utf-8"?>
      <network-security-config>
           <base-config cleartextTrafficPermitted="false" />
      
          <domain-config>
              <domain includeSubdomains="true">YOUR_DOMAIN_OR_IP</domain>
              <trust-anchors>
                  <!-- Trust a debug certificate in addition to the system certificates -->
                  <certificates src="system" />
                  <certificates src="@raw/tomcat" />
              </trust-anchors>
          </domain-config>
      </network-security-config>     
      

      Here we reference the formerly copied tomcat-certificate-file tomcat.cer in the line:

      <certificates src="@raw/tomcat" />
      
    2. Now we need to reference this new file in the Android-Manifest. In your application-tag add following attribute:

      android:networkSecurityConfig="@xml/network_security_config"
      

      resulting in somthing like this:

         <application android:name="org.your.Application"
         android:enabled="true"
         android:icon="@drawable/ic_launcher"
         android:label="@string/app_name" 
         android:allowBackup="false"
         android:networkSecurityConfig="@xml/network_security_config"
         >     
      
    3. TargetSDK: Insert something like this that fits your project as well right after the manifest-tag:

      <uses-sdk android:minSdkVersion="24" android:targetSdkVersion="29"/>
      

      If you choose a minSdkVersion < 24 you get warned:

      Attribute `networkSecurityConfig` is only used in API level 24 and higher (current min is 8)
      

      I don't know what that means. Does it mean that <24 devices won't work or don't need it, because they just call this host without knowing the CA?? EDIT:: In this case you will need to initialize the SSL-Certificate on your own, I tried to use the same method as I use for the desktop client but get some 'Unknown Class'-Exception. So for android-version < API-Level 24 I fall back to http. I will output some kind of warning about unsecure network-communication....

    4. project.properties: I set this to target android-29. Set for your project accordingly

      target=android-29
      
    5. Make sure to use the right address/port now and use 'https'. But from now on you line in 'safe'

      More read:

Export this post as PDF document  Export this post to PDF document

Social Bookmarks :  Add this post to Slashdot    Add this post to Digg    Add this post to Reddit    Add this post to Delicious    Add this post to Stumble it    Add this post to Google    Add this post to Technorati    Add this post to Bloglines    Add this post to Facebook    Add this post to Furl    Add this post to Windows Live    Add this post to Yahoo!

Working with old (Android 4) Eclipse-ADT based Android-Projects

As I'm trying to revive "Wood Games 3D" I obviously need to debug at some point on the device. But how to build it at all? Here the step I took:

  1. Install eclipse photon (newer versions might not work with the ADT-plugin)

  2. Go to help -> Eclipse Marketplace and search for ADT.

  3. Install ADT Android-Plugin

  4. Restart eclipse, install the SDKs you need.

  5. If you get an error telling you something like:

    Unknown error: Unable to build: the file dx.jar was not loaded from the SDK folder
    

    You can specify build-tools that do fit better your sdk (e.g. 19.1.0 ) in your project.properties-file

    # Project target.
    target=android-15
    # Build tools
    sdk.buildtools=19.1.0
    

    If that does not work you can try to download build-tools 25.0.3 and copy DxConsole.class to your current dx.jar. Like here
    More Read

  6. If you try to use "Debug as Android Application" and get an error like:

    Can't bind to local 8600 for debugger
    

    Go to eclipse->window->preferences->android->DDMS:

    1. Set 'debugger port to 8601'
    2. Check 'Use ADBHOST' (leave the value '127.0.0.1')
    3. kill the adb-server:
    adb kill-server
    
    1. restart eclipse
    2. Try to debug again: "Debug as Android Application" (I'm actually not sure if all steps are needed but those made the job for me,... I guess just restart eclipse is already enough... )
      More Read1 More Read2
    3. If you get some "ClassNotFoundException"s make sure all relevant projects and libraries are exported:
      Check here: "Project -> Properties -> Java Build Path -> Order & Export and ensure everything you want to be part of the apk is checked" More read

    Export this post as PDF document  Export this post to PDF document

    Social Bookmarks :  Add this post to Slashdot    Add this post to Digg    Add this post to Reddit    Add this post to Delicious    Add this post to Stumble it    Add this post to Google    Add this post to Technorati    Add this post to Bloglines    Add this post to Facebook    Add this post to Furl    Add this post to Windows Live    Add this post to Yahoo!

old-school patching

I actually can't remember when it was the last time I 'manually' patched a file. But it was quite common in the pre git-days. A patch basically is the same as a git-commit, telling the code where to insert what and where to remove what... As I'm trying to get 'Wood Games 3D' back to life, I first need to get it to compile. Strangely I did not keep my highly altered libgdx-version for some reason only one patch-file. At least I wrote down a date in the file (I guess that meant the day when I created the patch and not the day of its svn-revision). But still a good point to start.

A patch looks like something like this:

Index: src/com/badlogic/gdx/scenes/scene2d/ui/Label.java
===================================================================
--- src/com/badlogic/gdx/scenes/scene2d/ui/Label.java	(revision 2440)
+++ src/com/badlogic/gdx/scenes/scene2d/ui/Label.java	(working copy)
@@ -62,7 +62,7 @@
  *
  */
 public class Label extends Widget {		
-	final LabelStyle style;
+	LabelStyle style;
 	String label;
 	final TextBounds bounds = new TextBounds();
 	final Vector2 textPos = new Vector2();
@@ -139,4 +139,13 @@
 		this.label = text;
 		invalidateHierarchy();
 	}
+	
+	/**
+	 * Sets the {@link LabelStyle} of this Label  

In order to apply it to a folder. You need to 'cd' into it and write

patch -p0 < patch.txt

And then pray. 🙂 In my case I had a line ending mismatch resulting in lots of those errors:

Hunk #1 FAILED at 1 (different line endings).
Hunk #2 FAILED at 48 (different line endings).

And it makes sense. I developed the game on windows but I'm working now on my beloved linux. So, I applied dos2unix on both, the whole folder as well as on the patch:

find . -type f -print0 | xargs -0 dos2unix

(This command calls dos2unix on all files from the current folder upwards)

After this, calling the patch-command (as above) just worked. I call this a miracle 🙂

Refs:

Tags :

Export this post as PDF document  Export this post to PDF document

Social Bookmarks :  Add this post to Slashdot    Add this post to Digg    Add this post to Reddit    Add this post to Delicious    Add this post to Stumble it    Add this post to Google    Add this post to Technorati    Add this post to Bloglines    Add this post to Facebook    Add this post to Furl    Add this post to Windows Live    Add this post to Yahoo!

Docker: mysql5

In order to create a local mysql5 server with adminer web-addon:

  1. Create a file mysql.yaml:
# Use root/example as user/password credentials
version: '3'

services:

  db:
    image: mysql:5
    command: --default-authentication-plugin=mysql_native_password
    restart: always
    volumes:
      - ./data:/var/lib/mysql
    ports: 
      - 3306:3306
    environment:
      MYSQL_ROOT_PASSWORD: example


  adminer:
    image: adminer
    restart: always
    ports:
      - 8080:8080

Use docker-compose to install:

sudo docker-compose -f mysql.yaml up

Open browser at localhost:8080 using username/passwort root/example

References:

Tags : ,

Export this post as PDF document  Export this post to PDF document

Social Bookmarks :  Add this post to Slashdot    Add this post to Digg    Add this post to Reddit    Add this post to Delicious    Add this post to Stumble it    Add this post to Google    Add this post to Technorati    Add this post to Bloglines    Add this post to Facebook    Add this post to Furl    Add this post to Windows Live    Add this post to Yahoo!

pimp eclipse with a working(!) and beautiful color theme "Darkest Dark"

If you want to work with eclipse (as I do with trying to revive Wood Games 3D) and struggle with the default color themes and think "WTF" try the "Darkest Dark Theme". You can't imagine the difference.

Steps in Eclipse:

  1. Help > Eclipse Marketplace...
  2. Search > Find: 'Color Theme'
  3. Select "Darkest Dark Theme with Devstyle"

  4. Press 'Install Now', wait and restart eclipse.
  5. After Restart you (at least I had to) should change the javadoc-background-color, as it was for me black on black:
  • Window > Preferences > General > Appearance > Colors And Fonts > Java > Javadoc View Background
    Choose a color you find fitting. (Obviously you can also change the font color)
  1. Be happy:
  • ...I would say. But there is a strange flickering. Sometimes more sometimes less. Usually the bigger the problems with the code you are trying to understand, the harder it is flickering :D. I just found out (and I remember that I already knew this some time ago) that gtk3 is the problem.

    a) For new versions like eclipse 2020-03: Here eclipse itself points you to the solution (if you loog in the logs or start eclipse in the terminal):

    ***WARNING: Detected: GTK_IM_MODULE=xim. This input method is unsupported and can cause graphical issues.
    ***WARNING: Unset GTK_IM_MODULE or set GTK_IM_MODULE=ibus if flicking is experienced.
    

    b) For older eclipse versions: You can set it back to gtk2 to avoid that. Just insert following right before -vmargs (two lines):

    --launcher.GTK_version
    2
    

    You can check the gtk-version here: Help -> About -> Installation Details -> Configuration Tab -> org.eclipse.swt.internal.gtk.version
    More read More read2

Tags :

Export this post as PDF document  Export this post to PDF document

Social Bookmarks :  Add this post to Slashdot    Add this post to Digg    Add this post to Reddit    Add this post to Delicious    Add this post to Stumble it    Add this post to Google    Add this post to Technorati    Add this post to Bloglines    Add this post to Facebook    Add this post to Furl    Add this post to Windows Live    Add this post to Yahoo!

Project: 'Revive Wood Games 3D'


Ok, since I stumbled over my one and only thingy that I would call a game "Wood Games 3D" and made me sad, that it actually died. That had a couple of reasons. One was that I was too lazy to react to all of those google-play "You need to take action"-Emails. So actually there is only one reason. Me letting it die. There were minor other reasons. One e.g. that scoreloop the social-plugin I based some functionality on (leaderboards, friends, challenges and more) was closed... Not sure I will revive all functionalities but at least I want the leaderboards to be working again...

I will make it up to you, dear Woody. At least I will give it a try.

Day 1(2020-05-15):

  1. Starting with hardest part: setting up the project (eclipse + libgdx). I hope I actually have the latest sources :D But it looks ok...and I won't let me be discouraged by this state:

    Let's see what is what. Super exciting :D It's like a time travel and I'm prepared for some ugly spaghetti-code ;)
  • Well,...seems that I don't have my altered version of libgdx anywhere. I only found an old patch-file. What in hell did me not include the libgdx-library?

  • eclipse, my ide of choice in former days. But nowadays I struggle more with color-theme as anything. Lots of background/forecolor like white on lightgray or such....so painful. (I guess I done something wrong? This can't be default) But I found "Darkest Dark Theme with DevStyle" in eclipse-marketplace and it transformed the experience from (let's call it) undefined to beautiful. Really. Such a difference.

  • One thing you see here is again. Never use an IDE-dependent build-process. It funks you latest once the time passed by a bit...

  • I actually have also create at these days an server of my own (not sure about what features). It is using mysql5 via hibernate. I'm not 100% sure if I want to use this or to write a new mapping to e.g. nakama server. First of all I will check out if I can start my old 'faw'-server (which stands for fight'n'win ;) )

  • I finally managed to setup a mysql5-server via docker with the right user-managment settings setup. And here we are. The server initalized itself. Very exciting to see this work more or less out of the box. Let's see what my former me created there 😀

  • Ok, then I tried to get libgdx and the engine I put on top of it to work again. I really don't understand how stupid I was, that I did not pack the altered version of libgdx with the project!? At least I had the patch file that included a date "2011-07-29" in it and I hope it was refering to the date of the svn-revision of libgdx.

    Libgdx is now on github but it was no problem to get the state of this date and miraculously applying the patch worked more or less without real problem. With some manual work, I could compile the GdxEngine (which is my engine, put on libgdx for loading the blender-scene with materials and so on). So it's first time to commit the current state and then to import WoodGames into eclipse and see what is breaking. 0 Errors, nice. At least for now 😀

  • Well,...actually I made lots of progress and came to a point where I could compile without error. Even the connection to the server worked, but for some reason not a single texture can be loaded....to make it a 'bit' harder the lib for loading the image is a native one... actually it is a bit frustrating. Another point is that I don't have a clue how to create the APK as it is based on the old ADT-Plugin...I guess I will give it a try tomorrow to setup the old eclipse plus adt plus android-15. We'll see. But for today it's enough...

Day2(2020-05-16):

  • After a sleep I have new plans. First of all, I need to go one step back and see if the vanilla libgdx version that I patched actually worked. I did a test on their "hello-world" but that was using a whole bunch on included libs (including native ones) and did not point to the current projects... and then we will see.

  • And voila. It turned out that I had bad luck with the libgdx-commit I chose. They changed a native interface call but did not compile the corresponding native so/dll. So I just changed the native interface to version before and wood games (aka wood olympics show up). That was nasty and burned most of my time on this 😀. But that is the life of a bug-hunter 😀 Great start for day 2 which boosts my motiviation to 100% again....we can do this. 🤞

    Afaik the desktop version worked 100% with my faw-server, no scoreloop involved. You see this fancy login-screen....I'm optimistic that this might work quite fast 😀. At least if I can get keyboard-input to work...

  • oh man,...I don't get it. Keyboard-Controls are just ignored. Strange thing, JOGL as well as LWJGL is not reacting to any keyboard-input. Mouse works perfectly...I really shouldn't put too much time into this, as I need the keyboard only for the login-process...and the game itself will be played on android (where hopefully the keyboard work)....but I do want the keyboard do work 😀

  • Sry JOGL, that it did doubt you (I just used one of the libgdx-test-cases and did not test it on WoodGames itself (as with lwjgl)). You give me the keystrokes I need letting me shout out sounds of pure delight

  • Creating a new account worked out of the box. What a nice surprise. Every other access to the server seems to through an exception though. On both sides on client and server. Well I didn't expect less 😀

  • Bäämm, found that the problem was some setting in the MySQL-Database. Thx to internet and the right search query, it now works with the sql-queries as well 😉. As a reminder for me, executing this command as root on mysql did the job:

    SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));
    

    So now, I can actually create scores, they are added accordingly to the leaderboards. So good :D

  • Even the daily "world championship" works which was choosing one event and the best of this time-period gets a medal. That was actually a good design-decision as I really kept people playing it like crazy. Not many, but like crazy (aka daily)

  • It seems that at least for the desktop version everything seems to work now. Things that I need to add or change:

    1. The dashboard needs to give a chance to logout and login for another account. (It gives you already the option to change the name, what I do like.)
    2. Deactivate autologin (at the moment the last user is automatically logged in)
    3. Bring Back K7 (all disciplines combined to a multi-event)

    But before I start thinking about adding new code I need to try creating an apk out of it. And I do want to it to work with an ant-script and not with adt.

  • Nonetheless I have to setup adt to do some debugging. That worked with some flaws. At least I now can start debugging and see why it is not working ;).

  • So,...here we are. I could run "Wood Games 3D" on the phone, strangely the faw-dashboard was shown already, as usually this should only be done on desktop if I recall right. It actually did not create a user and it didn't work 100%, but it is quite a step for "bringing woody back to life".

  • Some braindeads later,... well,...for some reason I can't have multiple users, because hibernate refuses to add more user objects. I kind of remember that this problem occured at these days and there is a way around it, but I can't recall... I take a break and think about kicking faw and porting it to nakama-server

  • Well, actually I did not stop but switched into chaotic uncoordinated headless mode ;). Not even started with changing the server but wanted to put the game to a android-version with which I actually can publish to google play. But doing this seems to kill my network. I ended up using 3 different IDEs (eclipse photon with ADT, eclipse 2020-03 with 'Eclipse Andmore' and Android Studio creating a new project from scratch. And then trying all three simultaneously. This is madness? Yes, I agree.

Day 3:

  • After some sleep let's tidy up a bit first. My plan is to follow the approach with Eclipse Andmore (which is the successor of ADT). With this I was already able to target android 29 but the network (seems) to not work anymore. I lost somewhere the ability to debug...but still I need to focus on that. Sice I burned 2 days now, I cancel full-throttle mode. I will do till afternoon today and from tomorrow on, I will go on very reduced. (Which realistically might be the end of the effort)

  • Ok,...fore some reason I managed to not save the entry that should be already been written down here ;). So in short: I managed to establish a ssl-connection to my tomcat which is hosting the faw-server

  • I guess it's time for a roadmap for further work:

    1. transfer to gradle as build system I had a look into gradle. And eventhough it gave me much pain when using it (without knowing) for urho3d-android, I do like it. But moving all to gradle would be overkill. Especially as first try... In the end main motiviation was to be able to debug again. I switched back to eclipse photon + ADT and it works... 😀 Man, what an IDE-Roundtrip 😀😀

    2. establish debugging again (android studio?) eclipse photon + ADT it is. Btw, to switch back from Eclipse Andmore to ADT you need to alter the nature in the Android Project to

      <natures>
        <nature>com.android.ide.eclipse.adt.AndroidNature</nature>
        <nature>org.eclipse.jdt.core.javanature</nature>
      </natures>
      
    3. replace faw-server with nakama? I found out why no more players could be added to faw-server. The problem was that email had a unique-contraint on the database-site (hibernate) which obviously made problems when multiple users did not provide any....so current approach is to make it run with faw. Porting it to nakama is like with gradle before, it would be overkill (but nice)

Day 4:

  • Weekend is over and beside working on "Endzone - A World Apart", Wood-Games have low priority. But I found some late time:
    • Got Server working by setting again this "sql-group"-hack from above. Not sure what this does though.
    • Setting ssl-cert on desktop-version
    • and looked a bit deeper into the game-code.
    • Multiple Users playing "at the same time" works without problems
    • On Android the World-Championchip view is for some reason not visible (I guess because it uses the wrong game-id). At former days there were two separate game-modes for "desktop" and "android". I will cancel this, since desktop is actually not really for playing more for testing and showcasing. Desktop:

      The font is quite small. And on the phone it is hard to actually read anything. I guess this will be a todo later.

Day 5:

  • I found out why Daily Championchip is not visible. I had some kind of screen management where I had display-sizes managed up until y-dimensions of 800px and after that...nothing 😀. That was also a good location to scale the font for higher resolutions.
    I really do like this trip back in time...

    here a picture of my old HTC Desire(2010) and my other phones plus on desktop... Lovely, isn't it 😀
    Guess next step will be to see what happend with K7...

DAY 6:

  • Reactivated local scores that are stored only on the phone and are shown as "best 5" for each discipline.
  • Nice that I found out today that tomorrow is holiday. I cannot emphasize enough that I do like that fact. I guess tomorrow I will revive K7 - a combination of all disciplines into somekind of compound event...

Day 7:

  • "King7" is back. Now you can have the "decathlon" of the wood competiting in all events leading to one result...
  • Focusing the dashboard on android now moves the selected textfield in an visible area and prevents input being hidden by the virtual keyboard. Also fixed a bug that you couldn't select behind the last character....

Day 8:

  • Reenable password-reset:

    1. the user requests password-reset
    2. the user is lead to the servers website to do this. (do I want to integrate this ingame?? hmm,...i guess not)
    3. the user have to fill in username/password-combination.
    4. if this combination was saved on server the server sends an email to the email-address and a link
    5. if the link is hit, the user can fill in a new password.
    6. the password is changed...
  • Most time took as I had to establish a secure connection to gmail for sending the mail. The old way was not supported anymore and now you need to do so via oauth2-connection. To set this up, was not sooo straight forward, but doable if you know where to do what in the 'google developer console'. What really did help me was this blog post

  • Bugs I found and that needs to be fixed:

    1. Hall of Fame is not visible (just one line). Might be again only on big screens
    2. K7-Sore is not transfered properly (or at all?)
    3. Ingame I rely on the android-back-button to trigger things like showing the menu. I need to add a button for this effect

Day n:

I actually didn't write too much lately but was constantly fixing and changing stuff. Especially the login/user creation screen, layouting and more. I started with a page of points I wanted to tackle thinking that maybe afterwards I will be done just to end up with even more points afterwards.... still some things to do. I also wonder how to handle the european privacy thingy as I'm using a server (not really saving personal data though...) I would like to finish till sunday and reRelease someday next week? I'm a bit exhausted in the Wood case and want to be ready for new stuff :D

Tags :

Export this post as PDF document  Export this post to PDF document

Social Bookmarks :  Add this post to Slashdot    Add this post to Digg    Add this post to Reddit    Add this post to Delicious    Add this post to Stumble it    Add this post to Google    Add this post to Technorati    Add this post to Bloglines    Add this post to Facebook    Add this post to Furl    Add this post to Windows Live    Add this post to Yahoo!

Found my baby, Wood Games 3D

My baby, Wood Games 3D, is not available in google play anymore (for some time now), because I did not respond to some messages because of some new playstore regulations to which you had to answer. Actually this is quite sad. I created it with the libgdx-java library creating a nice blender to libgdx-pipeline. Even though I still have the sourcecode (somewhere) but it won't be super easy to create an apk.

But, I found it in one of those stores that release your apk without you even knowing. Now I'm thankful for that :D

WoodGames

To the game: https://apkpure.com/wood-games-3d/org.tt

And I still do love the trailer :D.

Can still remember how you did compete against a million of "cat-image-application" at these days :D Still unbelievable that you were on top of the game's category list after every update you published....but as I was saying, 1min after uploading, 10 "image"-apps (that were only showing one image rofl) kicked you out of the top10 and 10min later you were invisible again.

reminder: I really should revive some kind of games-page...

EDIT: Oh my,...I just found old stuff of wood games and even played it again, and I do love it. And I just decided...it is a shame that it is basically dead...I invested much work, fun and hate into it at these days... let's start 'Project: Revive Wood Games' even though I was planning to do something else this weekend...

Export this post as PDF document  Export this post to PDF document

Social Bookmarks :  Add this post to Slashdot    Add this post to Digg    Add this post to Reddit    Add this post to Delicious    Add this post to Stumble it    Add this post to Google    Add this post to Technorati    Add this post to Bloglines    Add this post to Facebook    Add this post to Furl    Add this post to Windows Live    Add this post to Yahoo!

Cross-Compiling with mingw: "mingw mutex is not a member of std"

Using spdlog as logger in my current project gives me an error when I try to cross compile it using my urho3d-docker-setup:

error: 'mutex' is not a member of 'std'

After asking the internet I found out that there are actually different mingw-compilers with different suffixes:

x86_64-w64-mingw32-gcc-win32
x86_64-w64-mingw32-gcc-posix

Where the upper seems not to work with mutex. (Actually strange, I compiled lots of stuff with Urho3d and its dependencies and I would have guess those would use at some point a mutex!?)

In the end I got everything compiled using the compiler with -posix suffix. (I altered the urho3d's mingw toolchain-file...)

If you want to see all possible "alternatives" of this gcc/g++ command you can do it like this:

update-alternatives --display x86_64-w64-mingw32-g++

And you can choose one in some kind of interactive mode:

update-alternatives --config x86_64-w64-mingw32-g++

You can also set it directly like this:

update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix # posix
update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-win32 # win32

Ref:

Export this post as PDF document  Export this post to PDF document

Social Bookmarks :  Add this post to Slashdot    Add this post to Digg    Add this post to Reddit    Add this post to Delicious    Add this post to Stumble it    Add this post to Google    Add this post to Technorati    Add this post to Bloglines    Add this post to Facebook    Add this post to Furl    Add this post to Windows Live    Add this post to Yahoo!

CMake: Copy files after build

If you need to e.g. bundle/copy data along your build you can use a call similar to this. Just make sure to select the target you want to 'target'.

Possible copy hooks are: PRE_BUILD | PRE_LINK | POST_BUILD

Single files

add_custom_command(
        TARGET ${PROJECT_NAME}  POST_BUILD
        COMMAND ${CMAKE_COMMAND} -E copy
                ${CMAKE_CURRENT_BINARY_DIR}/config/config.yaml
                ${CMAKE_CURRENT_BINARY_DIR}/bin/config/config.yaml)

Directories:

add_custom_command(TARGET ${PROJECT_NAME}  POST_BUILD
        COMMAND ${CMAKE_COMMAND} -E copy_directory
                ${CMAKE_CURRENT_SOURCE_DIR}/res
                ${CMAKE_CURRENT_BINARY_DIR}/res)

More read: https://cmake.org/cmake/help/v3.0/command/add_custom_command.html

Tags :

Export this post as PDF document  Export this post to PDF document

Social Bookmarks :  Add this post to Slashdot    Add this post to Digg    Add this post to Reddit    Add this post to Delicious    Add this post to Stumble it    Add this post to Google    Add this post to Technorati    Add this post to Bloglines    Add this post to Facebook    Add this post to Furl    Add this post to Windows Live    Add this post to Yahoo!

qt-creator: make stdout work in application-output-view

I really do love qt-creator and it is my IDE of choice for c++-development. But it has here and there some flaws....beside the fact that there are not tabs to represent the opened files, one strange thing is that outputs to stdout get are not visibile immediately. I'm not 100% sure how it is triggered (maybe when the internal buffer is filled completely?).

In order to show the output directly, just add this to your main.cpp:

setbuf(stdout, NULL);

Another flaw is that from time to time you have invalid start-configs and qt-creator refuses to start your application. This is due to the path not set properly. Here helps a restart and the path is set correctly afterwards

Reference(setbuf): https://bugreports.qt.io/browse/QTCREATORBUG-3994

Tags :

Export this post as PDF document  Export this post to PDF document

Social Bookmarks :  Add this post to Slashdot    Add this post to Digg    Add this post to Reddit    Add this post to Delicious    Add this post to Stumble it    Add this post to Google    Add this post to Technorati    Add this post to Bloglines    Add this post to Facebook    Add this post to Furl    Add this post to Windows Live    Add this post to Yahoo!

CMake Error: CMake can not determine linker language for target: [XYZ]

Just stumpled over a strange problem using CMake. A usually straight forward setup adding a 2nd executable lead to an error like this:

-- Configuring done
CMake Error: CMake can not determine linker language for target: Tests
-- Generating done

This might be related to me now using cmake 3.14 as minimum in the CMakeLists.txt-file or might be related to using CPM as CMake-internal package-manager (which requires 3.14). Not quite sure.

To make the long story short. I fixed it by adding following to the specific target:

    set_target_properties(Tests PROPERTIES LINKER_LANGUAGE CXX)

Reference: https://stackoverflow.com/questions/56462415/cmake-error-cannot-determine-link-language-for-target

Tags :

Export this post as PDF document  Export this post to PDF document

Social Bookmarks :  Add this post to Slashdot    Add this post to Digg    Add this post to Reddit    Add this post to Delicious    Add this post to Stumble it    Add this post to Google    Add this post to Technorati    Add this post to Bloglines    Add this post to Facebook    Add this post to Furl    Add this post to Windows Live    Add this post to Yahoo!
<< April 2020 | Home